Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2017 16:11:42 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 219926] sscanf(3): Inconsistent return value on match failures with patterns like "%*s%u" when compared to other implementations
Message-ID:  <bug-219926-8-nZ2oCB1LWL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-219926-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-219926-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219926

--- Comment #1 from Conrad Meyer <cem@freebsd.org> ---
The C11 standard says:

-------------------------------8<-------------------------------
Returns
3 The sscanf function returns the value of the macro EOF if an input failure
occurs before the first conversion (if any) has completed. Otherwise, the
sscanf function returns the number of input items assigned, which can be fe=
wer
than provided for, or even zero, in the event of an early matching failure.
-------------------------------8<-------------------------------

So the question is =E2=80=94 is "%*s" a conversion?

>From the fscanf part of C11:

-------------------------------8<-------------------------------
Each conversion specification is introduced by the character %.
After the %, the following appear in sequence:
=E2=80=94 An optional assignment-suppressing character *.
=E2=80=94 An optional decimal integer greater than zero that specifies the =
maximum
field width (in characters).
=E2=80=94 An optional length modifier that specifies the size of the receiv=
ing object.
=E2=80=94 A conversion specifier character that specifies the type of conve=
rsion to be
applied.
-------------------------------8<-------------------------------

So... maybe?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219926-8-nZ2oCB1LWL>