]> granicus.if.org Git - php/commitdiff
improve empty string check
authorAnatol Belski <ab@php.net>
Wed, 17 Sep 2014 07:16:59 +0000 (09:16 +0200)
committerAnatol Belski <ab@php.net>
Wed, 17 Sep 2014 07:16:59 +0000 (09:16 +0200)
ext/zip/lib/zip_set_name.c

index 02fa1272d624387f89ca453c9744631b53cbe070..4793c545344ebe6bf5c9a45661fbfba344d927d8 100644 (file)
@@ -58,7 +58,7 @@ _zip_set_name(struct zip *za, zip_uint64_t idx, const char *name, zip_flags_t fl
        return -1;
     }
 
-    if (name && strlen(name) > 0) {
+    if (name && name[0] != '\0') {
         /* TODO: check for string too long */
        if ((str=_zip_string_new((const zip_uint8_t *)name, (zip_uint16_t)strlen(name), flags, &za->error)) == NULL)
            return -1;