diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-03-10 21:07:25 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-03-10 21:07:25 +0000 |
commit | eff144ba79ef22841f4653a3e49aaf1450de866e (patch) | |
tree | 8f0952e90195966573c46ca4dd0f182e18bf70c4 /sys | |
parent | 4064dac86bddafdca1855f47b8451be98700aee6 (diff) |
Invoke va_end() before returning, rather than in an unreachable place; mickey@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/lib/libsa/printf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/lib/libsa/printf.c b/sys/lib/libsa/printf.c index dfb9ac9e662..bf8edd9306d 100644 --- a/sys/lib/libsa/printf.c +++ b/sys/lib/libsa/printf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printf.c,v 1.25 2012/12/05 23:20:23 deraadt Exp $ */ +/* $OpenBSD: printf.c,v 1.26 2015/03/10 21:07:24 miod Exp $ */ /* $NetBSD: printf.c,v 1.10 1996/11/30 04:19:21 gwr Exp $ */ /*- @@ -96,8 +96,10 @@ kdoprnt(void (*put)(int), const char *fmt, va_list ap) for (;;) { while ((ch = *fmt++) != '%') { - if (ch == '\0') + if (ch == '\0') { + va_end(ap); return; + } put(ch); } lflag = 0; @@ -228,7 +230,6 @@ reswitch: switch (ch = *fmt++) { put(ch); } } - va_end(ap); } void |