mirror of
https://github.com/curl/curl.git
synced 2026-07-23 13:17:18 +03:00
tool_writeout: fix the HTTP_CODE json output
Update test 970 accordingly. Reported-by: Michal Rus Fixes #6905 Closes #6906
This commit is contained in:
parent
2cd2686129
commit
2f78be51eb
2 changed files with 8 additions and 7 deletions
|
|
@ -259,12 +259,13 @@ static int writeLong(FILE *stream, const struct writeoutvar *wovar,
|
|||
|
||||
if(valid) {
|
||||
if(use_json)
|
||||
fprintf(stream, "\"%s\":", wovar->name);
|
||||
|
||||
if(wovar->id == VAR_HTTP_CODE || wovar->id == VAR_HTTP_CODE_PROXY)
|
||||
fprintf(stream, "%03ld", longinfo);
|
||||
else
|
||||
fprintf(stream, "%ld", longinfo);
|
||||
fprintf(stream, "\"%s\":%ld", wovar->name, longinfo);
|
||||
else {
|
||||
if(wovar->id == VAR_HTTP_CODE || wovar->id == VAR_HTTP_CODE_PROXY)
|
||||
fprintf(stream, "%03ld", longinfo);
|
||||
else
|
||||
fprintf(stream, "%ld", longinfo);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(use_json)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue