From: Sascha Schumann Date: Sun, 24 Nov 2002 16:23:37 +0000 (+0000) Subject: Use proper form of NUL X-Git-Tag: RELEASE_1_0b2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f6b470770571c9d7eaa63b9cb0754b52298dd5c;p=php Use proper form of NUL Drop superfluous checks for NULL results --- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 0b75af16fa..f82e1be7af 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2665,8 +2665,6 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t * buflen = strlen(strtext); /* will shrink, also we discover if * strtext */ buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */ - if (buffer == NULL) - return NULL; for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++) { switch (state) @@ -2731,9 +2729,7 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t * } } buffer = erealloc(buffer, buflen+1); - buffer[buflen] = 0; - if (buffer == NULL) - return NULL; + buffer[buflen] = '\0'; *retbuflen = buflen; return buffer;