aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-18 18:51:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-19 08:13:31 +0200
commit74623551f306990e70c7c5515b88972005604a74 (patch)
treec576cc60c28f654b6c55ace1f945018c0dd039a5
parent67521b5ecf0e3b0d8ea5278b02400811715069be (diff)
sendf: make failf() use the mvsnprintf() return code
... and avoid a strlen() call. Fixes a MonocleAI warning. Reported-by: MonocleAI Fixes #5413 Closes #5420
-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);