From 42fca623263599100746ce8e02f01b8c52311987 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 17 Sep 2014 09:16:59 +0200 Subject: [PATCH] improve empty string check --- ext/zip/lib/zip_set_name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.40.0