]> granicus.if.org Git - postgis/commitdiff
Another couple of warnings gone
authorSandro Santilli <strk@keybit.net>
Mon, 3 Jun 2013 17:45:21 +0000 (17:45 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 3 Jun 2013 17:45:21 +0000 (17:45 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11513 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/gserialized_estimate.c

index d0aed06ca6f94bffb2b03cb8db72f391d57de0e5..4e9460064a33c1ab968ed9cb6fad6767b71091f4 100644 (file)
@@ -860,12 +860,15 @@ pg_get_nd_stats_by_name(const Oid table_oid, const text *att_text, int mode)
        {
                /* Get the attribute number */
                att_num = get_attnum(table_oid, att_name);
-               if  ( ! att_num )
+               if  ( ! att_num ) {
                        elog(ERROR, "attribute \"%s\" does not exist", att_name);
+                       return NULL;
+               }
        }
        else 
        {
                elog(ERROR, "attribute name is null");
+               return NULL;
        }
        
        return pg_get_nd_stats(table_oid, att_num, mode);
@@ -1889,7 +1892,7 @@ Datum _postgis_gserialized_stats(PG_FUNCTION_ARGS)
        ND_STATS *nd_stats;
        char *str;
        text *json;
-       int mode;
+       int mode = 2; /* default to 2D mode */
        
        /* Check if we've been asked to not use 2d mode */
        if ( ! PG_ARGISNULL(2) )