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.)
This commit is contained in:
Neil Conway 2005-06-30 07:27:31 +00:00
parent 4802bb57a6
commit 117fde2d17

View File

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