aboutsummaryrefslogtreecommitdiffstats
path: root/vweprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'vweprintf.c')
-rw-r--r--vweprintf.c4
1 files changed, 2 insertions, 2 deletions
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);
}