scanf does just one character lookahead. Therefore, scanf using %f of "100ergs" should be a matching failure. This has existed since C89. The words in the current C17 standard (same as in C99) are: 188.8.131.52 The fscanf function
Paragraph 9: An input item is defined as the longest sequence of input characters which does not exceed any specified field width and which is, or is a prefix of, a matching input sequence.291) The first character, if any, after the input item remains unread.
291) 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
*** This bug has been marked as a duplicate of bug 1765 ***
Bug 12701 is the main open bug tracking this issue.
*** This bug has been marked as a duplicate of bug 12701 ***