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 /lib/http_digest.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 'lib/http_digest.c')
-rw-r--r-- | lib/http_digest.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/http_digest.c b/lib/http_digest.c index 91b88a383..0ed02493d 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -75,7 +75,7 @@ CURLcode Curl_output_digest(struct connectdata *conn, CURLcode result; struct Curl_easy *data = conn->data; unsigned char *path; - char *tmp; + char *tmp = NULL; char *response; size_t len; bool have_chlg; @@ -140,12 +140,14 @@ CURLcode Curl_output_digest(struct connectdata *conn, http://www.fngtps.com/2006/09/http-authentication */ - if(authp->iestyle && ((tmp = strchr((char *)uripath, '?')) != NULL)) { - size_t urilen = tmp - (char *)uripath; - - path = (unsigned char *) aprintf("%.*s", urilen, uripath); + if(authp->iestyle) { + tmp = strchr((char *)uripath, '?'); + if(tmp) { + size_t urilen = tmp - (char *)uripath; + path = (unsigned char *) aprintf("%.*s", urilen, uripath); + } } - else + if(!tmp) path = (unsigned char *) strdup((char *) uripath); if(!path) |