diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-01-10 01:45:32 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-01-10 01:45:32 +0000 |
commit | ef20f0f27e244591af53f0fd259f2d82ff1c3ea5 (patch) | |
tree | 7f58a3edf368e4a73663314c8495ffb2e50bea08 /sys/kern/subr_prf.c | |
parent | 9335e2a5bb0188cd7c1ab3bc5a70cc4362db29a1 (diff) |
NUL terminate the buffer in vsprintf
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r-- | sys/kern/subr_prf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 641dd90fa88..4f1fab02321 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_prf.c,v 1.23 1998/04/04 18:36:32 deraadt Exp $ */ +/* $OpenBSD: subr_prf.c,v 1.24 1999/01/10 01:45:31 niklas Exp $ */ /* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */ /*- @@ -569,13 +569,15 @@ vsprintf(buf, fmt, ap) va_list ap; { int savintr; + int len; savintr = consintr; /* disable interrupts */ consintr = 0; - kprintf(fmt, TOBUFONLY, NULL, buf, ap); + len = kprintf(fmt, TOBUFONLY, NULL, buf, ap); if (!panicstr) logwakeup(); consintr = savintr; /* reenable interrupts */ + buf[len] = 0; return (0); } |