On Sat, Dec 10, 2005 at 12:25:59AM +0100, Maxim Bourmistrov wrote:
> char buf[BUFSIZ] should be char buf[BUFSIZE]?
>
> # cat /tmp/diff
> --- lib/libc/string/strcpy.3.orig Sat Dec 10 00:23:29 2005
> +++ lib/libc/string/strcpy.3 Sat Dec 10 00:23:47 2005
> @@ -121,7 +121,7 @@
> .Em not
> guarantee to NUL terminate the string itself, it must be done by hand.
> .Bd -literal -offset indent
> -char buf[BUFSIZ];
> +char buf[BUFSIZE];
>
> (void)strncpy(buf, input, sizeof(buf) - 1);
> buf[sizeof(buf) - 1] = '\e0';
> #
No, this is strange but true. See /usr/include/stdio.h; BUFSIZ is set to
some value that will work well for buffers on this particular piece of
hardware, according to the C standards, IIRC.
Joachim