From: Orgad Shaneh Date: Mon, 3 Feb 2020 09:42:46 +0000 (+0200) Subject: curl: avoid using strlen for testing if a string is empty X-Git-Tag: curl-7_69_0~151 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bc373740a3;p=thirdparty%2Fcurl.git curl: avoid using strlen for testing if a string is empty Closes #4873 --- diff --git a/src/tool_getparam.c b/src/tool_getparam.c index b757ac8f04..1a72edf3ee 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -422,7 +422,7 @@ void parse_cert_parameter(const char *cert_parameter, /* escaped colons and Windows drive letter colons were handled * above; if we're still here, this is a separating colon */ param_place++; - if(strlen(param_place) > 0) { + if(*param_place) { *passphrase = strdup(param_place); } goto done; diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index 8a9b7c9e8f..7b9ff7d2aa 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -85,7 +85,7 @@ char *add_file_name_to_url(char *url, const char *filename) else ptr = url; ptr = strrchr(ptr, '/'); - if(!ptr || !strlen(++ptr)) { + if(!ptr || !*++ptr) { /* The URL has no file name part, add the local file name. In order to be able to do so, we have to create a new URL in another buffer.*/