summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-02-16 01:56:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-02-16 01:56:47 +0000
commit4241fa28fefb7d8629a28b063203c78f1ba91fac (patch)
tree5e0bd4f045f9a0d9e2ae112aeec845b7edee563f /lib/libc/stdio
parent30e7cbaff79c81f10d155653a4275e76f5105b10 (diff)
teach people about strlcpy, not strcpy
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/mktemp.34
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/mktemp.3 b/lib/libc/stdio/mktemp.3
index 10a79fb84d1..54c4e25eaf8 100644
--- a/lib/libc/stdio/mktemp.3
+++ b/lib/libc/stdio/mktemp.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mktemp.3,v 1.25 2000/12/24 00:30:58 aaron Exp $
+.\" $OpenBSD: mktemp.3,v 1.26 2003/02/16 01:56:46 deraadt Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -218,7 +218,7 @@ For instance, code of this form:
char sfn[15] = "";
FILE *sfp;
-strcpy(sfn, "/tmp/ed.XXXXXX");
+strlcpy(sfn, "/tmp/ed.XXXXXX", sizeof sfn);
if (mktemp(sfn) == NULL || (sfp = fopen(sfn, "w+")) == NULL) {
fprintf(stderr, "%s: %s\en", sfn, strerror(errno));
return (NULL);