From 1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 14 Dec 2016 01:29:44 +0100 Subject: checksrc: warn for assignments within if() expressions ... they're already frowned upon in our source code style guide, this now enforces the rule harder. --- tests/libtest/lib571.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/libtest/lib571.c') diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c index 32648ad12..40a78fa84 100644 --- a/tests/libtest/lib571.c +++ b/tests/libtest/lib571.c @@ -118,7 +118,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"); fclose(protofile); curl_global_cleanup(); @@ -126,7 +127,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; } @@ -147,7 +149,8 @@ int test(char *URL) goto test_cleanup; /* This PLAY starts the interleave */ - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -161,7 +164,8 @@ int test(char *URL) goto test_cleanup; /* The DESCRIBE request will try to consume data after the Content */ - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -174,7 +178,8 @@ int test(char *URL) if(res) goto test_cleanup; - if((stream_uri = suburl(URL, request++)) == NULL) { + stream_uri = suburl(URL, request++); + if(!stream_uri) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } -- cgit v1.2.1