Path: utzoo!attcan!uunet!husc6!bloom-beacon!gatech!hubcap!ncrcae!ncr-sd!ncrlnk!ncrcce!c10sd3!anderson
From: anderson@c10sd3.StPaul.NCR.COM (Joel Anderson)
Newsgroups: comp.lang.c
Subject: Curious Behaviour of "sscanf"
Keywords: sscanf, c compilers.
Message-ID: <236@c10sd3.StPaul.NCR.COM>
Date: 17 Jun 88 13:50:17 GMT
Reply-To: anderson@c10sd3.StPaul.NCR.COM (Joel Anderson)
Organization: NCR Comten, St. Paul, MN
Lines: 25
References:

People using the C compiler on NCR Towers here in St.Paul have noted
a curious (well, at least unexpected) behaviour in the sscanf function.

On a call to sscanf as follows:
               .
               .
               .
               if (sscanf(argv[3],"X=(%d,%d)",&y,&z) == 2) 
               .
               .
               .

and an input string where argv[3] is as follows:

               "X=(1,4"

(not including the double quotes), why does sscanf in this case evaluate to
true?  Sscanf matches the number of arguments but does not continue parsing
the control string (i.e. true even though the closing paren is missing)?

Perhaps this is correct - is it?

Thanks&shalom

Joel.