From: Tom Rini <trini@embeddedalley.com>
To: Artem Bityutskiy <dedekind@infradead.org>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
linux-mtd@lists.infradead.org
Subject: Re: ubi-utils updates for gcc-4.3.x
Date: Mon, 8 Dec 2008 09:06:20 -0700 [thread overview]
Message-ID: <20081208160620.GK15204@smtp.west.cox.net> (raw)
In-Reply-To: <1228741782.13686.124.camel@sauron>
On Mon, Dec 08, 2008 at 03:09:42PM +0200, Artem Bityutskiy wrote:
> On Mon, 2008-12-08 at 13:00 +0200, Artem Bityutskiy wrote:
> > >From man scanf:
> >
> > RETURN VALUE
> > These functions return the number of input items successfully
> > matched and assigned, which can be fewer than provided for, or even zero
> > in the event of an early matching failure.
> >
> > The value EOF is returned if the end of input is reached before either
> > the first successful conversion or a matching failure occurs. EOF is
> > also returned if a read error occurs, in which case the error indicator
> > for the stream (see ferror(3)) is set, and errno is set indicate the
> > error.
> >
> > On this basis, I would say you should test for EOF, not for 0.
> >
> > > + if (!scanf("%3s", buf))
> > > + return 0;
> >
> > Similarly.
> >
>
> If you are fine with this, I may amend your patch and push it, because
> otherwise it looks OK for me.
Sounds good to me, thanks.
--
Tom Rini
prev parent reply other threads:[~2008-12-08 16:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-08 8:02 ubi-utils updates for gcc-4.3.x Tom Rini
2008-12-08 11:00 ` Artem Bityutskiy
2008-12-08 13:09 ` Artem Bityutskiy
2008-12-08 16:06 ` Tom Rini [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=20081208160620.GK15204@smtp.west.cox.net \
--to=trini@embeddedalley.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=dedekind@infradead.org \
--cc=linux-mtd@lists.infradead.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