aboutsummaryrefslogtreecommitdiffstats
path: root/vweprintf.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-01 19:57:21 +0100
committerMattias Andrée <maandree@kth.se>2018-11-01 19:57:21 +0100
commit13e2ded64cfd0197f3eeb8427cee9a2e86425c65 (patch)
tree2bddfd3d0e1e7cc174a909b049b802cd70546e52 /vweprintf.c
parentMore header file documentation (diff)
downloadlibsimple-13e2ded64cfd0197f3eeb8427cee9a2e86425c65.tar.gz
libsimple-13e2ded64cfd0197f3eeb8427cee9a2e86425c65.tar.bz2
libsimple-13e2ded64cfd0197f3eeb8427cee9a2e86425c65.tar.xz
Documentation
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-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);
}