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

Commit117fde2

Browse files
author
Neil Conway
committed
Minor ecpg tweak: the return value of calloc() is guaranteed to be NULL
or zero-filled; therefore zero-filling it via memset() is pointless.(I think setting `errno' is probably a waste of cycles as well, but Ihaven't changed that.)
1 parent4802bb5 commit117fde2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎src/interfaces/ecpg/pgtypeslib/common.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
#include"extern.h"
44

5+
/* Return value is zero-filled. */
56
char*
67
pgtypes_alloc(longsize)
78
{
89
char*new= (char*)calloc(1L,size);
910

1011
if (!new)
11-
{
1212
errno=ENOMEM;
13-
returnNULL;
14-
}
15-
16-
memset(new,'\0',size);
1713
return (new);
1814
}
1915

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp