diff options
author | 2003-02-16 01:56:46 +0000 | |
---|---|---|
committer | 2003-02-16 01:56:46 +0000 | |
commit | 28c4ec9f162d26d7577088b2b3de1d81eb6fb411 (patch) | |
tree | fb5363a34357178c72f05dc894686591bc3c2cba /lib/libc/stdio | |
parent | strlcpy (diff) | |
download | wireguard-openbsd-28c4ec9f162d26d7577088b2b3de1d81eb6fb411.tar.xz wireguard-openbsd-28c4ec9f162d26d7577088b2b3de1d81eb6fb411.zip |
teach people about strlcpy, not strcpy
Diffstat (limited to 'lib/libc/stdio')
-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); |