summaryrefslogtreecommitdiff
path: root/sys/lib/libkern
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/lib/libkern
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/lib/libkern')
-rw-r--r--sys/lib/libkern/strcat.c6
-rw-r--r--sys/lib/libkern/strcpy.c6
2 files changed, 8 insertions, 4 deletions
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;