diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-02-16 01:56:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-02-16 01:56:47 +0000 |
commit | 4241fa28fefb7d8629a28b063203c78f1ba91fac (patch) | |
tree | 5e0bd4f045f9a0d9e2ae112aeec845b7edee563f | |
parent | 30e7cbaff79c81f10d155653a4275e76f5105b10 (diff) |
teach people about strlcpy, not strcpy
-rw-r--r-- | lib/libc/stdio/mktemp.3 | 4 |
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); |