com php-src: better way to check for an empty string: ext/standard/http_fopen_wrapper.c

From: Date: Sat, 13 Sep 2014 21:21:46 +0000
Subject: com php-src: better way to check for an empty string: ext/standard/http_fopen_wrapper.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81553@lists.php.net to get a copy of this message
Commit: e00d48490bbba38a2757b28dfd930dbdf4870331 Author: Anatol Belski <ab@php.net> Sat, 13 Sep 2014 20:12:21 +0200 Parents: f357628fc9b3d4e8ffdcb0131dbb13f469212342 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e00d48490bbba38a2757b28dfd930dbdf4870331 Log: better way to check for an empty string Changed paths: M ext/standard/http_fopen_wrapper.c Diff: diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 4bf86a4..45fa637 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);

« previous php.cvs (#81553) next »