Commit 2834fb6a authored by Michael Meskes's avatar Michael Meskes

Fixed a typo and made two mallocs Coverity friendly.

parent 4a445f5d
...@@ -38,7 +38,7 @@ main(void) ...@@ -38,7 +38,7 @@ main(void)
long l; long l;
int i, j, k, q, r, count = 0; int i, j, k, q, r, count = 0;
double dbl; double dbl;
decimal **decarr = (decimal **) malloc(1); decimal **decarr = (decimal **) calloc(1, sizeof(decimal));
ECPGdebug(1, stderr); ECPGdebug(1, stderr);
...@@ -71,7 +71,7 @@ main(void) ...@@ -71,7 +71,7 @@ main(void)
din = PGTYPESdecimal_new(); din = PGTYPESdecimal_new();
r = dectoasc(din, buf, BUFSIZE-1, 2); 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); printf("dec[%d,5]: r: %d, %s\n", i, r, buf);
r = dectolong(dec, &l); r = dectolong(dec, &l);
......
...@@ -58,7 +58,7 @@ main(void) ...@@ -58,7 +58,7 @@ main(void)
long l; long l;
int i, j, k, q, r, count = 0; int i, j, k, q, r, count = 0;
double dbl; double dbl;
decimal **decarr = (decimal **) malloc(1); decimal **decarr = (decimal **) calloc(1, sizeof(decimal));
ECPGdebug(1, stderr); ECPGdebug(1, stderr);
...@@ -91,7 +91,7 @@ main(void) ...@@ -91,7 +91,7 @@ main(void)
din = PGTYPESdecimal_new(); din = PGTYPESdecimal_new();
r = dectoasc(din, buf, BUFSIZE-1, 2); 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); printf("dec[%d,5]: r: %d, %s\n", i, r, buf);
r = dectolong(dec, &l); r = dectolong(dec, &l);
......
...@@ -48,7 +48,7 @@ main(void) ...@@ -48,7 +48,7 @@ main(void)
long l; long l;
int i, j, k, q, r, count = 0; int i, j, k, q, r, count = 0;
double d; double d;
numeric **numarr = (numeric **) malloc(1); numeric **numarr = (numeric **) calloc(1, sizeof(numeric));
ECPGdebug(1, stderr); ECPGdebug(1, stderr);
......
...@@ -30,7 +30,7 @@ main(void) ...@@ -30,7 +30,7 @@ main(void)
long l; long l;
int i, j, k, q, r, count = 0; int i, j, k, q, r, count = 0;
double d; double d;
numeric **numarr = (numeric **) malloc(1); numeric **numarr = (numeric **) calloc(1, sizeof(numeric));
ECPGdebug(1, stderr); ECPGdebug(1, stderr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment