summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_prf.c9
-rw-r--r--sys/lib/libkern/strcat.c6
-rw-r--r--sys/lib/libkern/strcpy.c6
3 files changed, 15 insertions, 6 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;
diff --git a/sys/lib/libkern/strcat.c b/sys/lib/libkern/strcat.c
index a493de8935a..477bb2d1d3a 100644
--- a/sys/lib/libkern/strcat.c
+++ b/sys/lib/libkern/strcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcat.c,v 1.4 1998/06/27 01:21:04 mickey Exp $ */
+/* $OpenBSD: strcat.c,v 1.5 2003/05/10 21:44:53 deraadt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -35,7 +35,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcat.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$OpenBSD: strcat.c,v 1.4 1998/06/27 01:21:04 mickey Exp $";
+static char *rcsid = "$OpenBSD: strcat.c,v 1.5 2003/05/10 21:44:53 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#if !defined(_KERNEL) && !defined(_STANDALONE)
@@ -44,6 +44,8 @@ static char *rcsid = "$OpenBSD: strcat.c,v 1.4 1998/06/27 01:21:04 mickey Exp $"
#include <lib/libkern/libkern.h>
#endif
+__warn_references(sprintf, "warning: strcat() is often misused, please use strlcpy()");
+
char *
strcat(s, append)
register char *s;
diff --git a/sys/lib/libkern/strcpy.c b/sys/lib/libkern/strcpy.c
index 7febef7de96..be82b0a1218 100644
--- a/sys/lib/libkern/strcpy.c
+++ b/sys/lib/libkern/strcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcpy.c,v 1.4 1998/06/27 01:21:07 mickey Exp $ */
+/* $OpenBSD: strcpy.c,v 1.5 2003/05/10 21:44:53 deraadt Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -35,7 +35,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strcpy.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$OpenBSD: strcpy.c,v 1.4 1998/06/27 01:21:07 mickey Exp $";
+static char *rcsid = "$OpenBSD: strcpy.c,v 1.5 2003/05/10 21:44:53 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#if !defined(_KERNEL) && !defined(_STANDALONE)
@@ -44,6 +44,8 @@ static char *rcsid = "$OpenBSD: strcpy.c,v 1.4 1998/06/27 01:21:07 mickey Exp $"
#include <lib/libkern/libkern.h>
#endif
+__warn_references(sprintf, "warning: strcpy() is often misused, please use strlcpy()");
+
char *
strcpy(to, from)
register char *to;