Bug 541828 followup: Convert "sizeof" result to signed integer, to fix signed-vs-unsigned build warning in nsZipArchive. r=tglek
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 28 Jan 2010 01:52:35 -0800
changeset 37604 46e12777d0ff2d60cc11a66076c3d4eb5fff7031
parent 37603 49b45b82988f1221b16bb64ddeb513db26a0ec3c
child 37605 6712bed154ed2b68f8658cd37732565fa6852783
push idunknown
push userunknown
push dateunknown
reviewerstglek
bugs541828
milestone1.9.3a1pre
Bug 541828 followup: Convert "sizeof" result to signed integer, to fix signed-vs-unsigned build warning in nsZipArchive. r=tglek
modules/libjar/nsZipArchive.cpp
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -533,17 +533,17 @@ nsresult nsZipArchive::BuildFileList()
       // of the end signature.  File must be corrupted!
       return NS_ERROR_FILE_CORRUPTED;
     }
   }
   PRUint32 centralOffset = xtolong(((ZipEnd *)buf)->offset_central_dir);
 
   //-- Read the central directory headers
   buf = startp + centralOffset;
-  if (endp - buf < sizeof(PRUint32))
+  if (endp - buf < PRInt32(sizeof(PRUint32)))
       return NS_ERROR_FILE_CORRUPTED;
   PRUint32 sig = xtolong(buf);
   while (sig == CENTRALSIG) {
     // Make sure there is enough data available.
     if (endp - buf < ZIPCENTRAL_SIZE)
       return NS_ERROR_FILE_CORRUPTED;
 
     // Read the fixed-size data.