From: Alejandro Colomar Date: Sat, 9 Dec 2023 12:35:19 +0000 (+0100) Subject: scanf.3: BUGS: It's impossible to know how many characters were consumed X-Git-Tag: man-pages-6.06~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=239c4bdd83bb09293248b93a3a218efa2d4cf017;p=thirdparty%2Fman-pages.git scanf.3: BUGS: It's impossible to know how many characters were consumed Suggested-by: Zack Weinberg Signed-off-by: Alejandro Colomar --- diff --git a/man3/scanf.3 b/man3/scanf.3 index 63f9c6dfd7..be335a5974 100644 --- a/man3/scanf.3 +++ b/man3/scanf.3 @@ -144,6 +144,15 @@ like the standard input stream. .P These functions can't report errors after the last non-suppressed conversion specification. +.SH BUGS +It is impossible to accurately know +how many characters these functions have consumed from the input stream, +since they only report the number of successful conversions. +For example, +if the input is "123\en\ a", +.I scanf(\[dq]%d\ %d\[dq], &a, &b) +will consume the digits, the newline, and the space, but not the letter a. +This makes it difficult to recover from invalid input. .SH SEE ALSO .BR fgets (3), .BR getline (3),