1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Fix signed/unsigned warning

This commit is contained in:
bel
2015-12-30 00:28:24 +01:00
parent 5ce5ca4b29
commit 6d4349d9d2

View File

@@ -4087,14 +4087,15 @@ alloc_vprintf(char **out_buf,
} else if ((size_t)(len) >= prealloc_size) {
/* The pre-allocated buffer not large enough. */
/* Allocate a new buffer. */
*out_buf = (char *)mg_malloc(len + 1);
*out_buf = (char *)mg_malloc((size_t)(len) + 1);
if (!*out_buf) {
/* Allocation failed. Return -1 as "out of memory" error. */
return -1;
}
/* Buffer allocation successful. Store the string there. */
va_copy(ap_copy, ap);
IGNORE_UNUSED_RESULT(vsnprintf_impl(*out_buf, len + 1, fmt, ap_copy));
IGNORE_UNUSED_RESULT(
vsnprintf_impl(*out_buf, (size_t)(len) + 1, fmt, ap_copy));
va_end(ap_copy);
} else {