On success, the function returns the number of items of the argument list successfully filled. This count can match the expected number of items or less (even zero) due to a matching failure, a reading error, or the reach of the end-of-file.

That is, if the function returns a value equal to or less than 0, it is likely that the reading has failed.

This feature can be used to know if what the user tries to enter is a number or not: