diff options
author | Neil Conway <neilc@samurai.com> | 2005-06-30 07:27:31 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2005-06-30 07:27:31 +0000 |
commit | 117fde2d1745c64c514db697b126350f7acf61a6 (patch) | |
tree | 9b812c870153ac9d3a5d3ed06ab20044a768e7fe /src | |
parent | 4802bb57a6d5331f32bc14bb196e397021fece1c (diff) | |
download | postgresql-117fde2d1745c64c514db697b126350f7acf61a6.tar.gz postgresql-117fde2d1745c64c514db697b126350f7acf61a6.zip |
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.)
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/common.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/common.c b/src/interfaces/ecpg/pgtypeslib/common.c index d4b40098089..903013a2e3a 100644 --- a/src/interfaces/ecpg/pgtypeslib/common.c +++ b/src/interfaces/ecpg/pgtypeslib/common.c @@ -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); } |