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 33706 b860d5122d45b95c0abd9f70081e792e166bcd33
parent 33705 6328a97b9400db303d733361d9b037aa15c7cd60
child 33707 0c83ead0ce8d19627b8f22d42f6cbae0cc207362
push id1142
push usertimeless@mozdev.org
push dateTue, 09 Mar 2010 14:35:12 +0000
reviewerstglek
bugs541828
milestone1.9.2.2pre
Bug 541828 followup: Convert "sizeof" result to signed integer, to fix signed-vs-unsigned build warning in nsZipArchive. r=tglek a=beltzner
modules/libjar/nsZipArchive.cpp
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -534,17 +534,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.