From 4241fa28fefb7d8629a28b063203c78f1ba91fac Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 16 Feb 2003 01:56:47 +0000 Subject: teach people about strlcpy, not strcpy --- lib/libc/stdio/mktemp.3 | 4 ++-- 1 file 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); -- cgit v1.2.3