diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-11-22 09:01:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-11-23 08:26:51 +0100 |
commit | dcd6f810255785d52b89150e18460fb0899d4f7e (patch) | |
tree | c3cb7cdcb79dbf752edcd997934e44a2e9998397 /lib/sendf.c | |
parent | 9944d6ba334f07b0b6199bdb5bb82091c88c16ed (diff) | |
download | curl-dcd6f810255785d52b89150e18460fb0899d4f7e.tar.gz |
snprintf: renamed and we now only use msnprintf()
The function does not return the same value as snprintf() normally does,
so readers may be mislead into thinking the code works differently than
it actually does. A different function name makes this easier to detect.
Reported-by: Tomas Hoger
Assisted-by: Daniel Gustafsson
Fixes #3296
Closes #3297
Diffstat (limited to 'lib/sendf.c')
-rw-r--r-- | lib/sendf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sendf.c b/lib/sendf.c index 77eacdf5f..e8598e617 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -237,7 +237,7 @@ void Curl_infof(struct Curl_easy *data, const char *fmt, ...) size_t len; char print_buffer[2048 + 1]; va_start(ap, fmt); - len = vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap); + len = mvsnprintf(print_buffer, sizeof(print_buffer), fmt, ap); /* * Indicate truncation of the input by replacing the last 3 characters * with "...", and transfer the newline over in case the format had one. @@ -245,9 +245,9 @@ void Curl_infof(struct Curl_easy *data, const char *fmt, ...) if(len >= sizeof(print_buffer)) { len = strlen(fmt); if(fmt[--len] == '\n') - snprintf(print_buffer + (sizeof(print_buffer) - 5), 5, "...\n"); + msnprintf(print_buffer + (sizeof(print_buffer) - 5), 5, "...\n"); else - snprintf(print_buffer + (sizeof(print_buffer) - 4), 4, "..."); + msnprintf(print_buffer + (sizeof(print_buffer) - 4), 4, "..."); } va_end(ap); len = strlen(print_buffer); @@ -266,7 +266,7 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...) size_t len; char error[CURL_ERROR_SIZE + 2]; va_start(ap, fmt); - vsnprintf(error, CURL_ERROR_SIZE, fmt, ap); + mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap); len = strlen(error); if(data->set.errorbuffer && !data->state.errorbuf) { |