This is an archive of the discontinued LLVM Phabricator instance.

[libc] fix scanf error handling
ClosedPublic

Authored by michaelrj on Dec 12 2022, 4:02 PM.

Details

Summary

Scanf is supposed to return EOF when it fails to make any conversions
and there is an input failure. Previously it would return EOF on a
matching failure, which may be an input failure but can also be a
parsing error.

Diff Detail

Event Timeline

michaelrj created this revision.Dec 12 2022, 4:02 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 12 2022, 4:02 PM
michaelrj requested review of this revision.Dec 12 2022, 4:02 PM
sivachandra accepted this revision.Dec 13 2022, 12:42 PM
This revision is now accepted and ready to land.Dec 13 2022, 12:42 PM
This revision was automatically updated to reflect the committed changes.