From: Anatol Belski Date: Wed, 17 Sep 2014 07:16:59 +0000 (+0200) Subject: improve empty string check X-Git-Tag: POST_NATIVE_TLS_MERGE^2~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42fca623263599100746ce8e02f01b8c52311987;p=php improve empty string check --- diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c index 02fa1272d6..4793c54534 100644 --- a/ext/zip/lib/zip_set_name.c +++ b/ext/zip/lib/zip_set_name.c @@ -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;