summaryrefslogtreecommitdiff
path: root/sys/kern/subr_prf.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-10 21:44:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-10 21:44:54 +0000
commit79fa1fd854eaf9e1b3f5d33b85b73043dc83cb03 (patch)
treeec513e3b486f62a965ac4322648f14c120f2ee11 /sys/kern/subr_prf.c
parentbe62c94672e1198c833b3f7b6171eb7d7946554e (diff)
warn for strcpy|strcat|sprintf|vsprintf; ok art dhartmei pval, and either henning or pb, i cannot tell which it was
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r--sys/kern/subr_prf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 32567d03d70..1ee17c7d8de 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_prf.c,v 1.47 2003/05/06 12:22:08 deraadt Exp $ */
+/* $OpenBSD: subr_prf.c,v 1.48 2003/05/10 21:44:53 deraadt Exp $ */
/* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */
/*-
@@ -539,6 +539,9 @@ vprintf(fmt, ap)
consintr = savintr; /* reenable interrupts */
}
+__warn_references(sprintf,
+ "warning: sprintf() is often misused, please use snprintf()");
+
/*
* sprintf: print a message to a buffer
*/
@@ -555,11 +558,13 @@ sprintf(char *buf, const char *fmt, ...)
return(retval);
}
+__warn_references(vsprintf,
+ "warning: vsprintf() is often misused, please use vsnprintf()");
+
/*
* vsprintf: print a message to the provided buffer [already have a
* va_list]
*/
-
int
vsprintf(buf, fmt, ap)
char *buf;