summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-12-16 08:50:46 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-12-16 08:53:03 +0100
commitbf70f1e22034d0ca9c72044630f8fbff5c2d4650 (patch)
tree51d4f29694ffddbf093ba16cff948b5bf1a4f05f
parentee09ec848fd3c3e7edaad4c6770a32b8c9728e88 (diff)
downloadcurl-bagder/checksrc-assignwithin.tar.gz
lib: remove ASSIGNWITHINCONDITION exceptions, use our code stylebagder/checksrc-assignwithin
... even for macros Reported-by: Jay Satiro Fixes #4683
-rw-r--r--lib/curl_multibyte.h9
-rw-r--r--lib/vssh/libssh.c10
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/curl_multibyte.h b/lib/curl_multibyte.h
index 5225e1811..3becf41cf 100644
--- a/lib/curl_multibyte.h
+++ b/lib/curl_multibyte.h
@@ -61,8 +61,13 @@ char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w);
#define Curl_convert_UTF8_to_tchar(ptr) Curl_convert_UTF8_to_wchar((ptr))
#define Curl_convert_tchar_to_UTF8(ptr) Curl_convert_wchar_to_UTF8((ptr))
-#define Curl_unicodefree(ptr) \
- do {if((ptr)) {free((ptr)); (ptr) = NULL;}} while(0)
+#define Curl_unicodefree(ptr) \
+ do { \
+ if(ptr) { \
+ free(ptr); \
+ (ptr) = NULL; \
+ } \
+ } while(0)
typedef union {
unsigned short *tchar_ptr;
diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c
index cad8b3786..62a7f1960 100644
--- a/lib/vssh/libssh.c
+++ b/lib/vssh/libssh.c
@@ -97,9 +97,13 @@
/* A recent macro provided by libssh. Or make our own. */
#ifndef SSH_STRING_FREE_CHAR
-/* !checksrc! disable ASSIGNWITHINCONDITION 1 */
-#define SSH_STRING_FREE_CHAR(x) \
- do { if((x) != NULL) { ssh_string_free_char(x); x = NULL; } } while(0)
+#define SSH_STRING_FREE_CHAR(x) \
+ do { \
+ if(x) { \
+ ssh_string_free_char(x); \
+ x = NULL; \
+ } \
+ } while(0)
#endif
/* Local functions: */