diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 15:43:25 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 23:44:17 +0100 |
commit | 8ab78f720ae478d533e30b202baec4b451741579 (patch) | |
tree | f476fa9496db2c92f32918acd66194b315b802c0 /lib/smb.c | |
parent | ec424f311aabfd34df1833878503236505e51656 (diff) | |
download | curl-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/smb.c')
-rw-r--r-- | lib/smb.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -124,13 +124,17 @@ const struct Curl_handler Curl_handler_smbs = { /* Append a string to an SMB message */ #define MSGCAT(str) \ - strcpy(p, (str)); \ - p += strlen(str); + do { \ + strcpy(p, (str)); \ + p += strlen(str); \ + } while(0) /* Append a null-terminated string to an SMB message */ #define MSGCATNULL(str) \ - strcpy(p, (str)); \ - p += strlen(str) + 1; + do { \ + strcpy(p, (str)); \ + p += strlen(str) + 1; \ + } while(0) /* SMB is mostly little endian */ #if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || \ |