On Fri, Nov 11, 2016 at 09:10:50PM -0600, Scott Cheloha wrote: > Hi, > > The end of lib/libc/string/wcscpy.3 reads: > > CAVEATS > Using the functions wcscpy() and wcsncpy() is very error-prone > with > respect to buffer overflows; see the EXAMPLES section in > strcpy(3) for > correct usage. Using wcslcpy(3) is a better choice in most > cases. > > But lib/libc/string/strcpy.3 has no EXAMPLES section. > > Seen on OpenBSD 6.0 AMD64 (installed from the CD media), still present in CVS. > > Cheers, > Scott Cheloha
morning. a few years ago the strcpy.3 page got split in order to create the strncpy.3 page. the EXAMPLES section went to that page, so i'm guessing that's where the reference should lie. it's a tough kind of thing to check when you make such changes. diff below. i'll commit it shortly if i don;t hear otherwise. jmc Index: wcscpy.3 =================================================================== RCS file: /cvs/src/lib/libc/string/wcscpy.3,v retrieving revision 1.4 diff -u -r1.4 wcscpy.3 --- wcscpy.3 25 Sep 2013 21:49:31 -0000 1.4 +++ wcscpy.3 12 Nov 2016 07:58:15 -0000 @@ -122,7 +122,7 @@ .Fn wcsncpy is very error-prone with respect to buffer overflows; see the EXAMPLES section in -.Xr strcpy 3 +.Xr strncpy 3 for correct usage. Using .Xr wcslcpy 3
