Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End of file not detected in %u scanf conversion #2384

Closed
vicuna opened this issue Mar 26, 2004 · 1 comment
Closed

End of file not detected in %u scanf conversion #2384

vicuna opened this issue Mar 26, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 26, 2004

Original bug ID: 2384
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Mike Talbot
Version: 3.07+2
OS: Linux 2.4.25
Submission from: abg-dwalsh.abingdon.geoquest.slb.com (134.32.10.96)

Since upgrading from 3.06 (I think) I have found a problem with the following
piece of code:

while true do
Scanf.scanf " %u " (fun x ->())
done

If I run this program and enter a few numbers, followed by ^D (or just attach
stdin to /dev/null) I get the following error:

Exception:
Scanf.Scan_failure "scanf: bad input at char number 0: decimal digit".

However, if I replace the %u with %i and repeat the test I get the following
(expected) message:

Exception: End_of_file.

@vicuna
Copy link
Author

vicuna commented Jul 2, 2004

Comment author: administrator

Assigned to PW

%u and %i behave the same on your test program.

@vicuna vicuna closed this as completed Jul 2, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant