aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/asset-directory-tool.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib-src/asset-directory-tool.c b/lib-src/asset-directory-tool.c
index e53398eceb0..239ab083b66 100644
--- a/lib-src/asset-directory-tool.c
+++ b/lib-src/asset-directory-tool.c
@@ -22,7 +22,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
22#include <stdio.h> 22#include <stdio.h>
23#include <fcntl.h> 23#include <fcntl.h>
24#include <errno.h> 24#include <errno.h>
25#include <endian.h> 25#include <byteswap.h>
26#include <stdlib.h> 26#include <stdlib.h>
27#include <dirent.h> 27#include <dirent.h>
28#include <string.h> 28#include <string.h>
@@ -197,7 +197,11 @@ main_2 (int fd, struct directory_tree *tree, size_t *offset)
197 croak ("write"); 197 croak ("write");
198 198
199 /* Write the offset. */ 199 /* Write the offset. */
200 output = htole32 (tree->offset); 200#ifdef WORDS_BIGENDIAN
201 output = bswap_32 (tree->offset);
202#else
203 output = tree->offset;
204#endif
201 if (write (fd, &output, 4) < 1) 205 if (write (fd, &output, 4) < 1)
202 croak ("write"); 206 croak ("write");
203 size += 4; 207 size += 4;