com php-src: improve empty string check: ext/zip/lib/zip_set _name.c
| From: | Anatol Belski | Date: | Wed, 17 Sep 2014 07:16:59 +0000 |
| Subject: | com php-src: improve empty string check: ext/zip/lib/zip_set _name.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81711@lists.php.net to get a copy of this message | ||
Commit: 42fca623263599100746ce8e02f01b8c52311987
Author: Anatol Belski <ab@php.net> Wed, 17 Sep 2014 09:16:59 +0200
Parents: 2ace2d1b8a0b8a250233b6dee2f019dae29b0faa
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=42fca623263599100746ce8e02f01b8c52311987
Log:
improve empty string check
Changed paths:
M ext/zip/lib/zip_set_name.c
Diff:
diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c
index 02fa127..4793c54 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;