]> granicus.if.org Git - postgresql/commitdiff
Fix ecpg test program to properly access int* null indicator.
authorBruce Momjian <bruce@momjian.us>
Tue, 13 Jan 2004 01:32:52 +0000 (01:32 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 13 Jan 2004 01:32:52 +0000 (01:32 +0000)
src/interfaces/ecpg/test/test3.pgc
src/interfaces/ecpg/test/test4.pgc

index 2cdde342003e1337042eea0676cc4d6d86efb27c..46e9d4904ab0e50be444ce5b89eb88b3478ed930 100644 (file)
@@ -68,7 +68,7 @@ exec sql end declare section;
                        printf(", born %ld", personal.birth.born);
                if (ind_personal.ind_birth.age >= 0)
                        printf(", age = %d", personal.birth.age);
-               if (ind_married >= 0)
+               if (*ind_married >= 0)
                        printf(", married %10.10s", married->arr);
                if (ind_children >= 0)
                        printf(", children = %d", children);
@@ -98,7 +98,7 @@ exec sql end declare section;
                        printf(", born %ld", personal.birth.born);
                if (ind_personal.ind_birth.age >= 0)
                        printf(", age = %d", personal.birth.age);
-               if (ind_married >= 0)
+               if (*ind_married >= 0)
                        printf(", married %10.10s", married->arr);
                if (ind_children >= 0)
                        printf(", children = %d", children);
index 7a4c49df53fd0c38f36ffb419051e00a43bef23f..10a5fdca1cf2cdee9d49a78afc791830e7e3ecbc 100644 (file)
@@ -1,5 +1,6 @@
 #include <locale.h>
 #include <string.h>
+#include <stdlib.h>
 
 exec sql whenever sqlerror sqlprint;