summaryrefslogtreecommitdiff
path: root/src/tool_writeout.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-12-14 01:29:44 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-12-14 01:29:44 +0100
commit1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b (patch)
treec1606588aeae4535f0faa7942fcbe50e6e340f8b /src/tool_writeout.c
parentb228d2952b6762b5c9b851fba0cf391e80c6761a (diff)
downloadcurl-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 'src/tool_writeout.c')
-rw-r--r--src/tool_writeout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tool_writeout.c b/src/tool_writeout.c
index e1b7819ed..2fb77742a 100644
--- a/src/tool_writeout.c
+++ b/src/tool_writeout.c
@@ -124,9 +124,14 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
char *end;
char keepit;
int i;
- if(('{' == ptr[1]) && ((end = strchr(ptr, '}')) != NULL)) {
+ if('{' == ptr[1]) {
bool match = FALSE;
+ end = strchr(ptr, '}');
ptr += 2; /* pass the % and the { */
+ if(!end) {
+ fputs("%{", stream);
+ continue;
+ }
keepit = *end;
*end = 0; /* zero terminate */
for(i = 0; replacements[i].name; i++) {