Fixed a typo and made two mallocs Coverity friendly.

This commit is contained in:
Michael Meskes 2006-08-15 12:46:25 +00:00
parent 4a445f5d97
commit 2834fb6a83
4 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);