Plexus P/40 System III Release 1.2 '

jim at ISM780B.UUCP jim at ISM780B.UUCP
Sat Mar 16 16:33:47 AEST 1985


>#include <stdio.h>
>
>main()
>{
>        char buff[64];
>
>        setbuf(stdout,buff);
>
>        fprintf(stdout,"This is a message\n");
>        fprintf(stderr,"And this is an error\n");
>}
>
>He dutifully compiled it with 'cc -o dork dork.c', and executed
>the resultant file.  Much to my surprise, this resulted in:
>
>And this is an error
>This~^R^G^Z^A~x^Rage

Quite expectable if you don't follow the documentation, which states that
the argument to setbuf is a char buf[BUFSIZ].  64 is < BUFSIZ.

-- Jim Balter, INTERACTIVE Systems (ima!jim)



More information about the Comp.unix.wizards mailing list