diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 15:43:25 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 15:43:25 +0100 |
commit | 6b4c9b8ae0f6283ed8282d56222dd42c119a14a3 (patch) | |
tree | 6429b245cd7212335295b7e05e601f8c5e097ca4 /lib | |
parent | 44a504e5e49dbfab6b3795471bef2cb337d3de49 (diff) | |
download | curl-6b4c9b8ae0f6283ed8282d56222dd42c119a14a3.tar.gz |
http_aws_sigv4: fix "warning: empty expression statement has no effect"
For the HMAC_SHA256 macro.
Bug: https://github.com/curl/curl/commit/08e8455dddc5e48e58a12ade3815c01ae3da3b64#commitcomment-45433279
Follow-up to 08e8455dddc5e4
Reported-by: Gisle Vanem
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http_aws_sigv4.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index a3aa72cdf..e1561d343 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -44,13 +44,15 @@ #include "memdebug.h" #define HMAC_SHA256(k, kl, d, dl, o) \ - if(Curl_hmacit(Curl_HMAC_SHA256, (unsigned char *)k, \ - (unsigned int)kl, \ - (unsigned char *)d, \ - (unsigned int)dl, o) != CURLE_OK) { \ - ret = CURLE_OUT_OF_MEMORY; \ - goto free_all; \ - } + do { \ + if(Curl_hmacit(Curl_HMAC_SHA256, (unsigned char *)k, \ + (unsigned int)kl, \ + (unsigned char *)d, \ + (unsigned int)dl, o) != CURLE_OK) { \ + ret = CURLE_OUT_OF_MEMORY; \ + goto free_all; \ + } \ + } while(0) #define PROVIDER_MAX_L 16 #define REQUEST_TYPE_L (PROVIDER_MAX_L + sizeof("4_request")) |