Fix check on NULL input for drawer function
authorCΓ©dric Villemain <cedric@2ndquadrant.fr>
Wed, 28 Sep 2016 13:23:29 +0000 (15:23 +0200)
committerCΓ©dric Villemain <cedric@2ndquadrant.fr>
Wed, 28 Sep 2016 13:23:29 +0000 (15:23 +0200)
The test was not done on the first argument..

pgfincore.c

index 8ac5c6359fbcef554a362239ee6b3d5dc4750729..b73d66bb2c2070270c777a49157602230e4f3bca 100644 (file)
@@ -1111,7 +1111,7 @@ pgfincore_drawer(PG_FUNCTION_ARGS)
        bits8 *sp;
        bits8 x;
 
-       if (PG_ARGISNULL(1))
+       if (PG_ARGISNULL(0))
                elog(ERROR, "pgfincore_drawer: databit argument shouldn't be NULL");
 
         databit        = PG_GETARG_VARBIT_P(0);