From: Anatol Belski Date: Sat, 13 Sep 2014 18:12:21 +0000 (+0200) Subject: better way to check for an empty string X-Git-Tag: PRE_NATIVE_TLS_MERGE~150^2~18^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e00d48490bbba38a2757b28dfd930dbdf4870331;p=php better way to check for an empty string --- diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 4bf86a4947..45fa637c0d 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -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);