com php-src: better way to check for empty string: ext/curl/interface.c

From: Date: Sun, 14 Sep 2014 20:07:38 +0000
Subject: com php-src: better way to check for empty string: ext/curl/interface.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81614@lists.php.net to get a copy of this message
Commit: 635a23128b018b7cafcf17bdc7131585b9606352 Author: Anatol Belski <ab@php.net> Sun, 14 Sep 2014 22:07:38 +0200 Parents: a7482fd2bf340e03b5c5c5ac4f94aacdabccb1ce Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=635a23128b018b7cafcf17bdc7131585b9606352 Log: better way to check for empty string Changed paths: M ext/curl/interface.c Diff: diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 1c7fe36..54a0abc 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1832,10 +1832,10 @@ static void _php_curl_set_default_options(php_curl *ch) curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ cainfo = INI_STR("openssl.cafile"); - if (!(cainfo && strlen(cainfo) > 0)) { + if (!(cainfo && cainfo[0] != '\0')) { cainfo = INI_STR("curl.cainfo"); } - if (cainfo && strlen(cainfo) > 0) { + if (cainfo && cainfo[0] != '\0') { curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo); }

« previous php.cvs (#81614) next »