summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_general.h
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2003-04-27 11:22:55 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2003-04-27 11:22:55 +0000
commitc670c56d6bb9915caf18009083d3515283a25fe1 (patch)
treeffee78ad4ad468acbebd70d511be258d28fdbd52 /sys/dev/raidframe/rf_general.h
parentc9c7d16545b1bfad4519f491aa113a57ab7c7b2d (diff)
strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.
Diffstat (limited to 'sys/dev/raidframe/rf_general.h')
-rw-r--r--sys/dev/raidframe/rf_general.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/raidframe/rf_general.h b/sys/dev/raidframe/rf_general.h
index 12d40fa82b2..b530f6ee0a0 100644
--- a/sys/dev/raidframe/rf_general.h
+++ b/sys/dev/raidframe/rf_general.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_general.h,v 1.5 2002/12/16 07:01:04 tdeval Exp $ */
+/* $OpenBSD: rf_general.h,v 1.6 2003/04/27 11:22:54 ho Exp $ */
/* $NetBSD: rf_general.h,v 1.5 2000/03/03 02:04:48 oster Exp $ */
/*
@@ -40,7 +40,7 @@
/* Error reporting and handling. */
#ifdef _KERNEL
-#include <sys/systm.h> /* printf, sprintf, and friends. */
+#include <sys/systm.h> /* printf, snprintf, and friends. */
#endif
#define RF_ERRORMSG(s) printf((s))
@@ -48,10 +48,11 @@
#define RF_ERRORMSG2(s,a,b) printf((s), (a), (b))
#define RF_ERRORMSG3(s,a,b,c) printf((s), (a), (b), (c))
-extern char rf_panicbuf[];
+extern char rf_panicbuf[2048];
#define RF_PANIC() \
do { \
- sprintf(rf_panicbuf, "RAIDframe error at line %d file %s", \
+ snprintf(rf_panicbuf, sizeof rf_panicbuf, \
+ "RAIDframe error at line %d file %s", \
__LINE__, __FILE__); \
panic(rf_panicbuf); \
} while (0)
@@ -64,7 +65,8 @@ do { \
#define RF_ASSERT(_x_) \
do { \
if (!(_x_)) { \
- sprintf(rf_panicbuf, "RAIDframe error at line %d" \
+ snprintf(rf_panicbuf, sizeof rf_panicbuf, \
+ "RAIDframe error at line %d" \
" file %s (failed asserting %s)\n", __LINE__, \
__FILE__, #_x_); \
panic(rf_panicbuf); \