X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3FAE4A3B.48713A03@phekda.freeserve.co.uk> Date: Sun, 09 Nov 2003 14:07:55 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: (fwd) Re: sscanf's return value References: <200308291742 DOT h7THgvTw005443 AT speedy DOT ludd DOT luth DOT se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Martin Str|mberg wrote: > I posted the following and still no comment. I think they agree > (silence is golden). The previous articles made their option > clear. Anyone not thinking so, please follow-up the article or one of > its siblings in the newsgroup. Hence we do have a bug in *scanf(). (No > I'm not volunteering to correct it.) After reading the C99 standard, I agree with what you wrote below. I'm going to use the examples as a new set of test cases. I'm trying to fix our sscanf. [snip] > Let's see if I got this now. > > ``sscanf("", "%*[0123456789]%*c");'' should return EOF (input > failure). > > ``sscanf("X", "%*[0123456789]%*c");'' should return 0 as there's not > an input failure but a matching failure. > > ``sscanf("1", "%*[0123456789]%*c");'' should return EOF as there's a > input failure after matching ``1''. > > ``sscanf("1X2", "%*[0123456789]%*[0123456789]"'' should return 0 as > there's a matching failure after matching ``1''. [snip] Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek