public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: Zhiheng Li <phoenix_lzh@sina.com>, Stefan Puiu <stefan.puiu@gmail.com>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: [PATCH] setbuf.3: fix the error in section BUGS
Date: Fri, 16 Apr 2021 12:02:07 +0200	[thread overview]
Message-ID: <ecd9f370-40d2-e2a0-400e-068a6029dcba@gmail.com> (raw)
In-Reply-To: <4fcc0db7-f9b9-a6ec-992b-84205e301618@sina.com>

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/

      parent reply	other threads:[~2021-04-16 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210412074443.15363-1-phoenix_lzh@sina.com>
2021-04-12  9:22 ` [PATCH] setbuf.3: fix the error in section BUGS Alejandro Colomar (man-pages)
     [not found]   ` <37c86142-a8a1-55ec-de3c-0fe48876860b@sina.com>
2021-04-15 11:48     ` Stefan Puiu
     [not found]       ` <4fcc0db7-f9b9-a6ec-992b-84205e301618@sina.com>
2021-04-16 10:02         ` Alejandro Colomar (man-pages) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecd9f370-40d2-e2a0-400e-068a6029dcba@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=phoenix_lzh@sina.com \
    --cc=stefan.puiu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox