Skip to content
Snippets Groups Projects
Commit 117fde2d authored by Neil Conway's avatar Neil Conway
Browse files

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 I
haven't changed that.)
parent 4802bb57
No related branches found
No related tags found
No related merge requests found
......@@ -2,18 +2,14 @@
#include "extern.h"
/* Return value is zero-filled. */
char *
pgtypes_alloc(long size)
{
char *new = (char *) calloc(1L, size);
if (!new)
{
errno = ENOMEM;
return NULL;
}
memset(new, '\0', size);
return (new);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment