diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-12-14 01:29:44 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-12-14 01:29:44 +0100 |
commit | 1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b (patch) | |
tree | c1606588aeae4535f0faa7942fcbe50e6e340f8b /tests/libtest/lib568.c | |
parent | b228d2952b6762b5c9b851fba0cf391e80c6761a (diff) | |
download | curl-1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b.tar.gz |
checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this
now enforces the rule harder.
Diffstat (limited to 'tests/libtest/lib568.c')
-rw-r--r-- | tests/libtest/lib568.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index 9b3a07787..0cdef812b 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -55,7 +55,8 @@ int test(char *URL) return TEST_ERR_MAJOR_BAD; } - if((curl = curl_easy_init()) == NULL) { + curl = curl_easy_init(); + if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; @@ -66,7 +67,8 @@ int test(char *URL) test_setopt(curl, CURLOPT_URL, URL); - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -100,7 +102,8 @@ int test(char *URL) sdpf = NULL; /* Make sure we can do a normal request now */ - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -115,7 +118,8 @@ int test(char *URL) /* Now do a POST style one */ - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -144,7 +148,8 @@ int test(char *URL) custom_headers = NULL; /* Make sure we can do a normal request now */ - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } |