]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/sscanf.3: Document exact matching for %c
authorFlorian Weimer <fweimer@redhat.com>
Fri, 28 Nov 2025 15:50:04 +0000 (16:50 +0100)
committerAlejandro Colomar <alx@kernel.org>
Mon, 1 Dec 2025 13:53:51 +0000 (14:53 +0100)
The glibc manual has always documented this behavior, but the
implementation differed, treating the field width as an upper limit.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
Message-ID: <lhu1pli6tsj.fsf@oldenburg.str.redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/sscanf.3

index f0b248518e406f3ba9c25c4d5529732b2872dbc7..fa4cd0db7578e9f836440226ef750689672ef98b 100644 (file)
@@ -172,6 +172,9 @@ and these discarded characters don't count toward the maximum field width.
 String input conversions store a terminating null byte (\[aq]\[rs]0\[aq])
 to mark the end of the input;
 the maximum field width does not include this terminator.
+Some conversions require exactly
+the number of characters specified in the maximum field width,
+or they fail.
 .TP
 \[bu]
 An optional
@@ -480,6 +483,10 @@ and there must be enough room for all the characters
 (no terminating null byte is added).
 The usual skip of leading white space is suppressed.
 To skip white space first, use an explicit space in the format.
+.\" glibc commit 2b16c76609350ec887d49afd4447743da38f7fab
+This conversion only succeeds
+if the number of characters specified by the maximum field
+can be matched.
 .TP
 .B \&[
 Matches a nonempty sequence of characters from the specified set of