]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
endian swap on FOURCC for "PACK" on BE systems.
authorDale Weiler <killfieldengine@gmail.com>
Fri, 8 Feb 2013 16:40:47 +0000 (16:40 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 8 Feb 2013 16:40:47 +0000 (16:40 +0000)
pak.c

diff --git a/pak.c b/pak.c
index 494ad7fd466679791f24fa40c640b51322fc7303..a272e9e0fd0a88c34460e2563c97239d12b52b30 100644 (file)
--- a/pak.c
+++ b/pak.c
@@ -210,6 +210,9 @@ static pak_file_t *pak_open_write(const char *file) {
     pak->insert       = true;
     pak->header.magic = PAK_FOURCC;
 
+    /* on BE systems we need to swap the byte order of the FOURCC */
+    util_endianswap(&pak->header.magic, 1, sizeof(uint32_t));
+
     /*
      * We need to write out the header since files will be wrote out to
      * this even with directory entries, and that not wrote.  The header