archivers/zip.c
changeset 161 4fcc863fdc5f
parent 149 1a630e60e12b
child 163 fc2b8ee5b420
--- a/archivers/zip.c	Wed Apr 03 04:17:54 2002 +0000
+++ b/archivers/zip.c	Wed Apr 03 04:20:07 2002 +0000
@@ -168,7 +168,9 @@
 
     while (offset > 0)
     {
-        PHYSFS_uint32 chunk = (offset > bufsize) ? bufsize : offset;
+        /* !!! - RYAN, CHECK THIS CAST */
+        /* !!! This should be okay since offset will be <= bufsize */
+        PHYSFS_uint32 chunk = (offset > bufsize) ? bufsize : (PHYSFS_uint32)offset;
         PHYSFS_sint32 rc = unzReadCurrentFile(fh, buf, chunk);
         BAIL_IF_MACRO(rc == 0, ERR_IO_ERROR, 0);  /* shouldn't happen. */
         BAIL_IF_MACRO(rc == UNZ_ERRNO, ERR_IO_ERROR, 0);
@@ -271,7 +273,9 @@
 static int version_does_symlinks(uLong version)
 {
     int retval = 0;
-    unsigned char hosttype = ((version >> 8) & 0xFF);
+    /* !!! - RYAN, CHECK THIS CAST */
+    /* !!! - You AND the result with 0xFF, so it can't be larger than 0xFF */
+    unsigned char hosttype = (unsigned char)((version >> 8) & 0xFF);
 
     /*
      * These are the platforms that can build an archive with symlinks,