提交 2834fb6a 编写于 作者: M Michael Meskes

Fixed a typo and made two mallocs Coverity friendly.

上级 4a445f5d
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册