]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fs: Use unsigned short for extra field and file comment lengths
authorCloudwalk <cloudwalk@icculus.org>
Fri, 24 Mar 2023 12:43:00 +0000 (08:43 -0400)
committerCloudwalk <cloudwalk@icculus.org>
Fri, 24 Mar 2023 12:45:02 +0000 (08:45 -0400)
fs.c

diff --git a/fs.c b/fs.c
index 44c15abb6083149f32944074158725adb74cd1a0..1fecfddb3dd3c7ef09e904ba685034a3d8856cab 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -743,7 +743,7 @@ static int PK3_BuildFileList (pack_t *pack, const pk3_endOfCentralDir_t *eocd)
                // Skip the name, additionnal field, and comment
                // 1er uint16 : extra field length
                // 2eme uint16 : file comment length
-               count = namesize + BuffLittleShort (&ptr[30]) + BuffLittleShort (&ptr[32]);
+               count = namesize + (unsigned short)BuffLittleShort (&ptr[30]) + (unsigned short)BuffLittleShort (&ptr[32]);
                ptr += ZIP_CDIR_CHUNK_BASE_SIZE + count;
                remaining -= count;
        }