aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2006-08-15 12:46:25 +0000
committerMichael Meskes <meskes@postgresql.org>2006-08-15 12:46:25 +0000
commit2834fb6a834342e5298609e371183521b395675e (patch)
tree07419055e8762f13bb239f060897d1ad68b8030f /src
parent4a445f5d9729a18d039c67b6235d07f75471599f (diff)
downloadpostgresql-2834fb6a834342e5298609e371183521b395675e.tar.gz
postgresql-2834fb6a834342e5298609e371183521b395675e.zip
Fixed a typo and made two mallocs Coverity friendly.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/test/compat_informix/dec_test.pgc4
-rw-r--r--src/interfaces/ecpg/test/expected/compat_informix-dec_test.c4
-rw-r--r--src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c2
-rw-r--r--src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/test/compat_informix/dec_test.pgc b/src/interfaces/ecpg/test/compat_informix/dec_test.pgc
index 8f6f109dcfc..8e333206b5b 100644
--- a/src/interfaces/ecpg/test/compat_informix/dec_test.pgc
+++ b/src/interfaces/ecpg/test/compat_informix/dec_test.pgc
@@ -38,7 +38,7 @@ main(void)
long l;
int i, j, k, q, r, count = 0;
double dbl;
- decimal **decarr = (decimal **) malloc(1);
+ decimal **decarr = (decimal **) calloc(1, sizeof(decimal));
ECPGdebug(1, stderr);
@@ -71,7 +71,7 @@ main(void)
din = PGTYPESdecimal_new();
r = dectoasc(din, buf, BUFSIZE-1, 2);
- if (!r < 0) check_errno();
+ if (r < 0) check_errno();
printf("dec[%d,5]: r: %d, %s\n", i, r, buf);
r = dectolong(dec, &l);
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c
index fd5d5c7868d..f9f0bf3ab11 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c
@@ -58,7 +58,7 @@ main(void)
long l;
int i, j, k, q, r, count = 0;
double dbl;
- decimal **decarr = (decimal **) malloc(1);
+ decimal **decarr = (decimal **) calloc(1, sizeof(decimal));
ECPGdebug(1, stderr);
@@ -91,7 +91,7 @@ main(void)
din = PGTYPESdecimal_new();
r = dectoasc(din, buf, BUFSIZE-1, 2);
- if (!r < 0) check_errno();
+ if (r < 0) check_errno();
printf("dec[%d,5]: r: %d, %s\n", i, r, buf);
r = dectolong(dec, &l);
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c
index 6fa54a4c250..3e20f10b1ad 100644
--- a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c
+++ b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c
@@ -48,7 +48,7 @@ main(void)
long l;
int i, j, k, q, r, count = 0;
double d;
- numeric **numarr = (numeric **) malloc(1);
+ numeric **numarr = (numeric **) calloc(1, sizeof(numeric));
ECPGdebug(1, stderr);
diff --git a/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc b/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc
index 19329cedb20..c4bbe74441d 100644
--- a/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc
+++ b/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc
@@ -30,7 +30,7 @@ main(void)
long l;
int i, j, k, q, r, count = 0;
double d;
- numeric **numarr = (numeric **) malloc(1);
+ numeric **numarr = (numeric **) calloc(1, sizeof(numeric));
ECPGdebug(1, stderr);