From: arisawa <karisawa@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] pipe: bug or feature?
Date: Tue, 28 Mar 2017 12:33:41 +0900 [thread overview]
Message-ID: <F679B551-FEA6-46D8-916D-3592605D2E0F@gmail.com> (raw)
In-Reply-To: <CAMVULc591M5Bt6p4fG9a8-sE1Sa=G9WJu+saFwQgmauXPTR_9A@mail.gmail.com>
OK! you are right!
I was careless.
thanks.
Kenji Arisawa
> 2017/03/28 11:27、Alex Musolino <musolinoa@gmail.com> のメール:
>
> is this a bug or a feature of pipe?
>
> It is a bug in your code. When you do buf[n] = 0 in the last while
> loop, you are writing past the end of buf. This causes pfd[0] to
> become 0 and so the next read is actually from stdin. Making buf
> larger "fixes" the problem because n=256 becomes a valid index.
>
> --
> Cheers,
> Alex Musolino
prev parent reply other threads:[~2017-03-28 3:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-28 1:42 arisawa
2017-03-28 2:27 ` [9front] " Alex Musolino
2017-03-28 3:33 ` arisawa [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=F679B551-FEA6-46D8-916D-3592605D2E0F@gmail.com \
--to=karisawa@gmail.com \
--cc=9front@9front.org \
/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;
as well as URLs for NNTP newsgroup(s).