Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2834fb6

Browse files
author
Michael Meskes
committed
Fixed a typo and made two mallocs Coverity friendly.
1 parent4a445f5 commit2834fb6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

‎src/interfaces/ecpg/test/compat_informix/dec_test.pgc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ main(void)
3838
long l;
3939
int i, j, k, q, r, count = 0;
4040
double dbl;
41-
decimal **decarr = (decimal **)malloc(1);
41+
decimal **decarr = (decimal **)calloc(1, sizeof(decimal));
4242

4343
ECPGdebug(1, stderr);
4444

@@ -71,7 +71,7 @@ main(void)
7171

7272
din = PGTYPESdecimal_new();
7373
r = dectoasc(din, buf, BUFSIZE-1, 2);
74-
if (!r < 0) check_errno();
74+
if (r < 0) check_errno();
7575
printf("dec[%d,5]: r: %d, %s\n", i, r, buf);
7676

7777
r = dectolong(dec, &l);

‎src/interfaces/ecpg/test/expected/compat_informix-dec_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ main(void)
5858
longl;
5959
inti,j,k,q,r,count=0;
6060
doubledbl;
61-
decimal**decarr= (decimal**)malloc(1);
61+
decimal**decarr= (decimal**)calloc(1,sizeof(decimal));
6262

6363
ECPGdebug(1,stderr);
6464

@@ -91,7 +91,7 @@ main(void)
9191

9292
din=PGTYPESdecimal_new();
9393
r=dectoasc(din,buf,BUFSIZE-1,2);
94-
if (!r<0)check_errno();
94+
if (r<0)check_errno();
9595
printf("dec[%d,5]: r: %d, %s\n",i,r,buf);
9696

9797
r=dectolong(dec,&l);

‎src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ main(void)
4848
longl;
4949
inti,j,k,q,r,count=0;
5050
doubled;
51-
numeric**numarr= (numeric**)malloc(1);
51+
numeric**numarr= (numeric**)calloc(1,sizeof(numeric));
5252

5353
ECPGdebug(1,stderr);
5454

‎src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ main(void)
3030
long l;
3131
int i, j, k, q, r, count = 0;
3232
double d;
33-
numeric **numarr = (numeric **)malloc(1);
33+
numeric **numarr = (numeric **)calloc(1, sizeof(numeric));
3434

3535
ECPGdebug(1, stderr);
3636

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp