From 13e2ded64cfd0197f3eeb8427cee9a2e86425c65 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 1 Nov 2018 19:57:21 +0100 Subject: Documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- vweprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vweprintf.c') diff --git a/vweprintf.c b/vweprintf.c index 491763b..96a82a7 100644 --- a/vweprintf.c +++ b/vweprintf.c @@ -20,13 +20,13 @@ libsimple_vweprintf(const char *fmt, va_list ap) va_list ap1; va_list ap2; - if (!argv0 || !strncmp(fmt, "usage: ", strlen("usage: "))) + if (!argv0 || !strncmp(fmt, "usage: ", sizeof("usage: ") - 1)) prefix1 = prefix2 = ""; va_copy(ap1, ap); va_copy(ap2, ap); r = vsnprintf(NULL, 0, fmt, ap1); - if (0 <= r && (size_t)r < SIZE_MAX) { + if (0 <= r && r < 8096) { message = alloca((size_t)r + 1); vsprintf(message, fmt, ap2); } -- cgit v1.2.3-70-g09d2