diff options
author | Mattias Andrée <maandree@kth.se> | 2018-11-01 19:57:21 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-11-01 19:57:21 +0100 |
commit | 13e2ded64cfd0197f3eeb8427cee9a2e86425c65 (patch) | |
tree | 2bddfd3d0e1e7cc174a909b049b802cd70546e52 /vweprintf.c | |
parent | More header file documentation (diff) | |
download | libsimple-13e2ded64cfd0197f3eeb8427cee9a2e86425c65.tar.gz libsimple-13e2ded64cfd0197f3eeb8427cee9a2e86425c65.tar.bz2 libsimple-13e2ded64cfd0197f3eeb8427cee9a2e86425c65.tar.xz |
Documentation
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'vweprintf.c')
-rw-r--r-- | vweprintf.c | 4 |
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); } |