]> granicus.if.org Git - php/commitdiff
better way to check for an empty string
authorAnatol Belski <ab@php.net>
Sat, 13 Sep 2014 18:12:21 +0000 (20:12 +0200)
committerAnatol Belski <ab@php.net>
Sat, 13 Sep 2014 21:21:46 +0000 (23:21 +0200)
ext/standard/http_fopen_wrapper.c

index 4bf86a4947401bf4cde3c094f90b56b9edeee2d7..45fa637c0de40ca47929109d7598e0ff4a65752b 100644 (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);