summaryrefslogtreecommitdiff
path: root/lib/vauth/digest.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-26 15:43:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-26 23:44:17 +0100
commit8ab78f720ae478d533e30b202baec4b451741579 (patch)
treef476fa9496db2c92f32918acd66194b315b802c0 /lib/vauth/digest.c
parentec424f311aabfd34df1833878503236505e51656 (diff)
downloadcurl-8ab78f720ae478d533e30b202baec4b451741579.tar.gz
misc: fix "warning: empty expression statement has no effect"
Turned several macros into do-while(0) style to allow their use to work find with semicolon. Bug: https://github.com/curl/curl/commit/08e8455dddc5e48e58a12ade3815c01ae3da3b64#commitcomment-45433279 Follow-up to 08e8455dddc5e4 Reported-by: Gisle Vanem Closes #6376
Diffstat (limited to 'lib/vauth/digest.c')
-rw-r--r--lib/vauth/digest.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c
index 5fc928526..559852fcb 100644
--- a/lib/vauth/digest.c
+++ b/lib/vauth/digest.c
@@ -61,12 +61,14 @@
It converts digest text to ASCII so the MD5 will be correct for
what ultimately goes over the network.
*/
-#define CURL_OUTPUT_DIGEST_CONV(a, b) \
- result = Curl_convert_to_network(a, b, strlen(b)); \
- if(result) { \
- free(b); \
- return result; \
- }
+#define CURL_OUTPUT_DIGEST_CONV(a, b) \
+ do { \
+ result = Curl_convert_to_network(a, b, strlen(b)); \
+ if(result) { \
+ free(b); \
+ return result; \
+ } \
+ } while(0)
#endif /* !USE_WINDOWS_SSPI */
bool Curl_auth_digest_get_pair(const char *str, char *value, char *content,