summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-18 18:51:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-18 18:51:37 +0200
commitdb29a0c4a96b414128e2f73751bd33b4e210b639 (patch)
treec0594418b7514ac02e3d9b41cbfbffaae447fc4b
parent5646e563aeb37e0ffdfbb7f8c4faf2455056e8a9 (diff)
downloadcurl-bagder/sendf-snprintf.tar.gz
sendf: make failf() use the mvsnprintf() return codebagder/sendf-snprintf
... and avoid a strlen() call. Fixes a MonocleAI warning. Reported-by: MonocleAI Fixes #5413
-rw-r--r--lib/sendf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 6ad32e1b3..92caf7cec 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -267,8 +267,7 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
size_t len;
char error[CURL_ERROR_SIZE + 2];
va_start(ap, fmt);
- mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
- len = strlen(error);
+ len = mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
if(data->set.errorbuffer && !data->state.errorbuf) {
strcpy(data->set.errorbuffer, error);