From 1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 14 Dec 2016 01:29:44 +0100 Subject: checksrc: warn for assignments within if() expressions ... they're already frowned upon in our source code style guide, this now enforces the rule harder. --- src/tool_getparam.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/tool_getparam.c') diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 247f8d38c..9b5c9a54c 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -757,7 +757,11 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ case '@': /* the URL! */ { struct getout *url; - if(config->url_get || ((config->url_get = config->url_list) != NULL)) { + + if(!config->url_get) + config->url_get = config->url_list; + + if(config->url_get) { /* there's a node here, if it already is filled-in continue to find an "empty" node */ while(config->url_get && (config->url_get->flags & GETOUT_URL)) @@ -1687,7 +1691,9 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ /* output file */ { struct getout *url; - if(config->url_out || ((config->url_out = config->url_list) != NULL)) { + if(!config->url_out) + config->url_out = config->url_list; + if(config->url_out) { /* there's a node here, if it already is filled-in continue to find an "empty" node */ while(config->url_out && (config->url_out->flags & GETOUT_OUTFILE)) @@ -1824,7 +1830,9 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ /* we are uploading */ { struct getout *url; - if(config->url_out || ((config->url_out = config->url_list) != NULL)) { + if(!config->url_out) + config->url_out = config->url_list; + if(config->url_out) { /* there's a node here, if it already is filled-in continue to find an "empty" node */ while(config->url_out && (config->url_out->flags & GETOUT_UPLOAD)) -- cgit v1.2.3