1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 18:22:42 +01:00

better way to check for an empty string

This commit is contained in:
Anatol Belski
2014-09-13 20:12:21 +02:00
parent f357628fc9
commit e00d48490b

View File

@@ -437,7 +437,7 @@ finish:
/* Remove newlines and spaces from start and end php_trim will estrndup() */
tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
}
if (tmp && strlen(tmp) > 0) {
if (tmp && tmp[0] != '\0') {
char *s;
user_headers = estrdup(tmp);