1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-12 04:25:08 -05:00

curl: avoid using strlen for testing if a string is empty

Closes #4873
This commit is contained in:
Orgad Shaneh 2020-02-03 11:42:46 +02:00 committed by Daniel Stenberg
parent f41deddde8
commit 2bc373740a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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.*/