diff options
-rw-r--r-- | lib/libcom_err/com_err.c | 2 | ||||
-rw-r--r-- | lib/libusbhid/usage.c | 6 | ||||
-rw-r--r-- | lib/libwrap/diag.c | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/libcom_err/com_err.c b/lib/libcom_err/com_err.c index b6ce80e026e..8c1fac1a683 100644 --- a/lib/libcom_err/com_err.c +++ b/lib/libcom_err/com_err.c @@ -60,7 +60,7 @@ error_message (long code) strncpy(msg, p, sizeof(msg) - 1); msg[sizeof(msg) - 1] = 0; } else - sprintf(msg, "Unknown error %ld", code); + snprintf(msg, sizeof msg, "Unknown error %ld", code); return msg; } diff --git a/lib/libusbhid/usage.c b/lib/libusbhid/usage.c index be6cf49a180..67c9b113e49 100644 --- a/lib/libusbhid/usage.c +++ b/lib/libusbhid/usage.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usage.c,v 1.3 2002/06/11 05:20:19 jsyn Exp $ */ +/* $OpenBSD: usage.c,v 1.4 2002/06/19 07:12:42 deraadt Exp $ */ /* $NetBSD: usage.c,v 1.1 2001/12/28 17:45:27 augustss Exp $ */ /* @@ -163,7 +163,7 @@ hid_usage_page(int i) for (k = 0; k < npages; k++) if (pages[k].usage == i) return pages[k].name; - sprintf(b, "0x%04x", i); + snprintf(b, sizeof b, "0x%04x", i); return b; } @@ -191,7 +191,7 @@ hid_usage_in_page(unsigned int u) return pages[k].page_contents[j].name; } bad: - sprintf(b, "0x%04x", i); + snprintf(b, sizeof b, "0x%04x", i); return b; } diff --git a/lib/libwrap/diag.c b/lib/libwrap/diag.c index 31c0a65ad45..2a7e3e45f4e 100644 --- a/lib/libwrap/diag.c +++ b/lib/libwrap/diag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diag.c,v 1.3 2002/06/07 00:05:09 itojun Exp $ */ +/* $OpenBSD: diag.c,v 1.4 2002/06/19 07:12:42 deraadt Exp $ */ /* * Routines to report various classes of problems. Each report is decorated @@ -15,7 +15,7 @@ #if 0 static char sccsid[] = "@(#) diag.c 1.1 94/12/28 17:42:20"; #else -static char rcsid[] = "$OpenBSD: diag.c,v 1.3 2002/06/07 00:05:09 itojun Exp $"; +static char rcsid[] = "$OpenBSD: diag.c,v 1.4 2002/06/19 07:12:42 deraadt Exp $"; #endif #endif @@ -47,10 +47,10 @@ va_list ap; char fmt[BUFSIZ]; if (tcpd_context.file) - sprintf(fmt, "%s: %s, line %d: %s", + snprintf(fmt, sizeof fmt, "%s: %s, line %d: %s", tag, tcpd_context.file, tcpd_context.line, format); else - sprintf(fmt, "%s: %s", tag, format); + snprintf(fmt, sizeof fmt, "%s: %s", tag, format); vsyslog(severity, fmt, ap); } |