diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 16:39:20 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 16:39:20 +0100 |
commit | 1557829c6c69f481d8d5b2cfb92cfab3d3f80dd4 (patch) | |
tree | 95a386bd03f184806d6d43e98fda86c91e6d52b7 /src | |
parent | 6b4c9b8ae0f6283ed8282d56222dd42c119a14a3 (diff) | |
download | curl-bagder/aws-macro-warning.tar.gz |
fixup more empty expressions fixedbagder/aws-macro-warning
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_formparse.c | 29 | ||||
-rw-r--r-- | src/tool_operate.c | 5 | ||||
-rw-r--r-- | src/tool_writeout_json.c | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 1ba6536a1..fa81291a6 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -720,19 +720,22 @@ static int get_param_part(struct OperationConfig *config, char endchar, ***************************************************************************/ /* Convenience macros for null pointer check. */ -#define NULL_CHECK(ptr, init, retcode) { \ - (ptr) = (init); \ - if(!(ptr)) { \ - warnf(config->global, "out of memory!\n"); \ - curl_slist_free_all(headers); \ - Curl_safefree(contents); \ - return retcode; \ - } \ -} -#define SET_TOOL_MIME_PTR(m, field, retcode) { \ - if(field) \ - NULL_CHECK((m)->field, strdup(field), retcode); \ -} +#define NULL_CHECK(ptr, init, retcode) \ + do { \ + (ptr) = (init); \ + if(!(ptr)) { \ + warnf(config->global, "out of memory!\n"); \ + curl_slist_free_all(headers); \ + Curl_safefree(contents); \ + return retcode; \ + } \ + } while(0) + +#define SET_TOOL_MIME_PTR(m, field, retcode) \ + do { \ + if(field) \ + NULL_CHECK((m)->field, strdup(field), retcode); \ + } while(0) int formparse(struct OperationConfig *config, const char *input, diff --git a/src/tool_operate.c b/src/tool_operate.c index 9e80ca2e5..5635483d1 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -362,10 +362,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global, } else #endif - if(config->synthetic_error) { - ; - } - else if(result && global->showerror) { + if(!config->synthetic_error && result && global->showerror) { fprintf(global->errors, "curl: (%d) %s\n", result, (per->errorbuffer[0]) ? per->errorbuffer : curl_easy_strerror(result)); diff --git a/src/tool_writeout_json.c b/src/tool_writeout_json.c index 78e60b7a4..186ed6851 100644 --- a/src/tool_writeout_json.c +++ b/src/tool_writeout_json.c @@ -74,7 +74,7 @@ static void jsonEscape(FILE *stream, const char *in) fputc(*i, stream); } break; - }; + } } } |