]> granicus.if.org Git - php/commitdiff
Removed pointless check.
authorIlia Alshanetsky <iliaa@php.net>
Mon, 26 Apr 2004 20:14:11 +0000 (20:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 26 Apr 2004 20:14:11 +0000 (20:14 +0000)
ext/yp/yp.c

index 2a312a4d4aca8e602bb6a22c4adbfbc4b7b0ac97..d8979a4bd594bcf1ebfab3306f291543f279a981 100644 (file)
@@ -297,13 +297,9 @@ static int php_foreach_cat (int instatus, char *inkey, int inkeylen, char *inval
        {
                if (inkeylen) {
                        char *key = emalloc(inkeylen+1);
-                       if(key) {
-                               strlcpy(key, inkey, inkeylen+1);
-                               add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1);
-                               efree(key);
-                       } else {
-                               php_error(E_WARNING, "Can't allocate %d bytes for key buffer in yp_cat()", inkeylen+1);
-                       }
+                       strlcpy(key, inkey, inkeylen+1);
+                       add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1);
+                       efree(key);
                }
 
                return 0;