Skip to content

Commit 5cecb73

Browse files
committed
Fix ecpg test program to properly access int* null indicator.
1 parent 67af5ba commit 5cecb73

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/interfaces/ecpg/test/test3.pgc

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ exec sql end declare section;
6868
printf(", born %ld", personal.birth.born);
6969
if (ind_personal.ind_birth.age >= 0)
7070
printf(", age = %d", personal.birth.age);
71-
if (ind_married >= 0)
71+
if (*ind_married >= 0)
7272
printf(", married %10.10s", married->arr);
7373
if (ind_children >= 0)
7474
printf(", children = %d", children);
@@ -98,7 +98,7 @@ exec sql end declare section;
9898
printf(", born %ld", personal.birth.born);
9999
if (ind_personal.ind_birth.age >= 0)
100100
printf(", age = %d", personal.birth.age);
101-
if (ind_married >= 0)
101+
if (*ind_married >= 0)
102102
printf(", married %10.10s", married->arr);
103103
if (ind_children >= 0)
104104
printf(", children = %d", children);

src/interfaces/ecpg/test/test4.pgc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <locale.h>
22
#include <string.h>
3+
#include <stdlib.h>
34

45
exec sql whenever sqlerror sqlprint;
56

0 commit comments

Comments
 (0)