Re: [PATCH] setbuf.3: fix the error in section BUGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Zhiheng,

On 4/16/21 11:28 AM, Zhiheng Li wrote:
Hi Stefan

After doing some tests, I also found that the buffer was flushed out of main. Thank you for telling me that. Even if the following program can print "Hello, world!"(Just replace 100 with BUFSIZ in your example), it is illegal. Because buf is used outside the scope of buf when fulshing.
#include <stdio.h>
int main(void)
{
     char buf[BUFSIZ];
     setbuf(stdout, buf);
     printf("Hello, world!\n");
     return 0;
}
So there is only a typo of 'stdout' in man pages. Could you fix it? Thanks.


Sure!  Fixed.  Thanks for the report :)

Cheers,

Alex


--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux