]> granicus.if.org Git - postgis/commitdiff
Fix up return type
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Oct 2017 22:54:15 +0000 (22:54 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Oct 2017 22:54:15 +0000 (22:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15963 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwin_wkb.c

index e01275d31d03baa7816f30502bc3919a4f6bd075..676520c75658ea0c7cdb48b7cf502eab0c9eb96d 100644 (file)
@@ -28,6 +28,7 @@
 #include "liblwgeom_internal.h" /* NOTE: includes lwgeom_log.h */
 #include "lwgeom_log.h"
 #include <math.h>
+#include <limits.h>
 
 /**
 * Used for passing the parse state between the parsing functions.
@@ -335,14 +336,14 @@ static POINTARRAY* ptarray_from_wkb_state(wkb_parse_state *s)
        size_t pa_size;
        uint32_t ndims = 2;
        uint32_t npoints = 0;
-       static uint32_t maxpoints = 4294967295 / WKB_DOUBLE_SIZE / 4;
+       static uint32_t maxpoints = UINT_MAX / WKB_DOUBLE_SIZE / 4;
 
        /* Calculate the size of this point array. */
        npoints = integer_from_wkb_state(s);
        if (npoints > maxpoints)
        {
                lwerror("Pointarray length (%d) is too large");
-               return;
+               return NULL;
        }
 
        LWDEBUGF(4,"Pointarray has %d points", npoints);