summaryrefslogtreecommitdiffstats
path: root/man3/scanf.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/scanf.3')
-rw-r--r--man3/scanf.39
1 files changed, 9 insertions, 0 deletions
diff --git a/man3/scanf.3 b/man3/scanf.3
index 63f9c6dfd..be335a597 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),