diff options
author | Tim Angus <tim@ngus.net> | 2013-03-26 16:50:03 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-03-27 11:33:16 +0000 |
commit | ecf45acd236aaf1a0d2b00a94a24d8f24fbceae4 (patch) | |
tree | 23d703104aa48a4533daed653d5c429f73dccb05 /src/qcommon/unzip.c | |
parent | a6e5804c1162832fa99d31c88033cbf6f1efd2f0 (diff) |
Fix some of the things clang --analyze flagged
Diffstat (limited to 'src/qcommon/unzip.c')
-rw-r--r-- | src/qcommon/unzip.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/qcommon/unzip.c b/src/qcommon/unzip.c index 2dd0bf83..4fb2d3a9 100644 --- a/src/qcommon/unzip.c +++ b/src/qcommon/unzip.c @@ -713,18 +713,13 @@ local int unzlocal_GetCurrentFileInfoInternal (file, if (lSeek!=0) { - if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else + if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0) err=UNZ_ERRNO; } if ((file_info.size_file_comment>0) && (commentBufferSize>0)) if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) err=UNZ_ERRNO; - lSeek+=file_info.size_file_comment - uSizeRead; } - else - lSeek+=file_info.size_file_comment; if ((err==UNZ_OK) && (pfile_info!=NULL)) *pfile_info=file_info; @@ -1144,13 +1139,12 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) pfile_in_zip_read_info->stream.next_in = (voidpf)0; pfile_in_zip_read_info->stream.avail_in = 0; - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) + if (inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS) == Z_OK) pfile_in_zip_read_info->stream_initialised=1; else { TRYFREE(pfile_in_zip_read_info); - return err; + return UNZ_INTERNALERROR; } /* windowBits is passed < 0 to tell that there is no zlib header. * Note that in this case inflate *requires* an extra "dummy" byte @@ -1197,7 +1191,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) # endif - return UNZ_OK; + return err; } extern int ZEXPORT unzOpenCurrentFile (file) |