diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-01-27 16:39:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-01-28 07:55:25 +0100 |
commit | 553f286a8f17e84b6957101ab37b7d817a6a2929 (patch) | |
tree | c762ef54ad971fab97717e1bfff985a6e31f6819 /src/tool_writeout.c | |
parent | 3611f6a41e3059654085307fa5a3011912f255f6 (diff) | |
download | curl-553f286a8f17e84b6957101ab37b7d817a6a2929.tar.gz |
tool_writeout: make %{errormsg} blank for no errors
Closes #6539
Diffstat (limited to 'src/tool_writeout.c')
-rw-r--r-- | src/tool_writeout.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tool_writeout.c b/src/tool_writeout.c index 9ce0a997e..c548bd8f2 100644 --- a/src/tool_writeout.c +++ b/src/tool_writeout.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -137,8 +137,9 @@ void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo, fprintf(stream, "%d", (int)result); break; case VAR_ERRORMSG: - fputs(per->errorbuffer[0] ? per->errorbuffer : - curl_easy_strerror(result), stream); + if(result) + fputs(per->errorbuffer[0] ? per->errorbuffer : + curl_easy_strerror(result), stream); break; case VAR_INPUT_URL: if(per->this_url) |