diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-06 12:22:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-06 12:22:09 +0000 |
commit | 0b3038a4d0d0ca5ee1e2b60a64dbcb4e2f6e7998 (patch) | |
tree | cb03d59472c7e3c9801e8838105d23170ebd98c3 /sys/kern/subr_prf.c | |
parent | 222466fcd0699a0a7f684c8570af739449ea79d9 (diff) |
use snprintf
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r-- | sys/kern/subr_prf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 3954c1527aa..32567d03d70 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_prf.c,v 1.46 2003/01/13 18:32:03 weingart Exp $ */ +/* $OpenBSD: subr_prf.c,v 1.47 2003/05/06 12:22:08 deraadt Exp $ */ /* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */ /*- @@ -198,7 +198,7 @@ panic(const char *fmt, ...) if (panicstr) bootopt |= RB_NOSYNC; else { - vsprintf(panicbuf, fmt, ap); + vsnprintf(panicbuf, sizeof panicbuf, fmt, ap); panicstr = panicbuf; } va_end(ap); @@ -290,7 +290,7 @@ logpri(level) char snbuf[KPRINTF_BUFSIZE]; kputchar('<', TOLOG, NULL); - sprintf(snbuf, "%d", level); + snprintf(snbuf, sizeof snbuf, "%d", level); for (p = snbuf ; *p ; p++) kputchar(*p, TOLOG, NULL); kputchar('>', TOLOG, NULL); @@ -782,11 +782,11 @@ reswitch: switch (ch) { _uquad = va_arg(ap, u_int); b = va_arg(ap, char *); if (*b == 8) - sprintf(buf, "%llo", _uquad); + snprintf(buf, sizeof buf, "%llo", _uquad); else if (*b == 10) - sprintf(buf, "%lld", _uquad); + snprintf(buf, sizeof buf, "%lld", _uquad); else if (*b == 16) - sprintf(buf, "%llx", _uquad); + snprintf(buf, sizeof buf, "%llx", _uquad); else break; b++; |