From: Dale Weiler Date: Fri, 8 Feb 2013 16:40:47 +0000 (+0000) Subject: endian swap on FOURCC for "PACK" on BE systems. X-Git-Tag: before-library~125 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=02230ca992fdd72067430798a07529893cd216e4;p=xonotic%2Fgmqcc.git endian swap on FOURCC for "PACK" on BE systems. --- diff --git a/pak.c b/pak.c index 494ad7f..a272e9e 100644 --- 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