]> granicus.if.org Git - postgis/commitdiff
Quiet warnings: unsigned ints can't be negative
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 22 Jul 2015 12:35:40 +0000 (12:35 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 22 Jul 2015 12:35:40 +0000 (12:35 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13822 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shpopen.c

index 444c07bc3b79ed7799970f6987dd24c2e92b391e..3db93e1bb1e27977d4305eb57d7b5bb983a70c39 100644 (file)
@@ -1702,8 +1702,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
         if( bBigEndian ) SwapWord( 4, &nPoints );
         if( bBigEndian ) SwapWord( 4, &nParts );
 
-        if (nPoints < 0 || nParts < 0 ||
-            nPoints > 50 * 1000 * 1000 || nParts > 10 * 1000 * 1000)
+        if (nPoints > 50 * 1000 * 1000 || nParts > 10 * 1000 * 1000)
         {
             snprintf(szErrorMsg, sizeof(szErrorMsg),
                      "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d.",
@@ -1901,7 +1900,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
 
         if( bBigEndian ) SwapWord( 4, &nPoints );
 
-        if (nPoints < 0 || nPoints > 50 * 1000 * 1000)
+        if (nPoints > 50 * 1000 * 1000)
         {
             snprintf(szErrorMsg, sizeof(szErrorMsg),
                      "Corrupted .shp file : shape %d : nPoints = %d",