diff options
| author | Sascha Schumann <sas@php.net> | 2002-11-24 16:23:37 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 2002-11-24 16:23:37 +0000 |
| commit | 3f6b470770571c9d7eaa63b9cb0754b52298dd5c (patch) | |
| tree | c0e23a4f1e43e015b7994d7dad5afb7e2c6fc980 | |
| parent | 2ddbee008f3688afd2f81ee6cf243081ce140a71 (diff) | |
| download | php-git-3f6b470770571c9d7eaa63b9cb0754b52298dd5c.tar.gz | |
Use proper form of NUL
Drop superfluous checks for NULL results
| -rw-r--r-- | ext/pgsql/pgsql.c | 6 |
1 files changed, 1 insertions, 5 deletions
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; |
