summaryrefslogtreecommitdiff
path: root/libc/stdio/scanf.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-05-21 16:19:42 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-05-21 16:19:42 +0000
commit8662b5d09896d537141eea24eef5a8f17aea7fc2 (patch)
tree6c906dd961afed61213c94ed723ecad7b0bdcc8c /libc/stdio/scanf.c
parenta17d863945361b067988adb12efee72651905845 (diff)
Add comment about scanf pushback behavior and glibc difference.
Diffstat (limited to 'libc/stdio/scanf.c')
-rw-r--r--libc/stdio/scanf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index a8f9f0ed0..dbb92392c 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -18,6 +18,17 @@
* fix this, I need to rework the "ungetc" machinery in stdio.c again.
* I do have one reference though, that seems to imply scanf has a single
* character of lookahead.
+ *
+ * May 20, 2001
+ *
+ * Quote from ANSI/ISO C99 standard:
+ *
+ * fscanf pushes back at most one input character onto the input stream.
+ * Therefore, some sequences that are acceptable to strtod, strtol, etc.,
+ * are unacceptable to fscanf.
+ *
+ * So uClibc's *scanf functions conform to the standard, and glibc's
+ * implementation doesn't for the "100ergs" case mentioned above.
*/
#include <stdlib.h>