OSDN Git Service

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 2cdde34..46e9d49 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 7a4c49d..10a5fdc 100644 (file)
@@ -1,5 +1,6 @@
 #include <locale.h>
 #include <string.h>
+#include <stdlib.h>
 
 exec sql whenever sqlerror sqlprint;