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

Non-decimal conversion in scanf #3459

Closed
vicuna opened this issue Jul 25, 2002 · 2 comments
Closed

Non-decimal conversion in scanf #3459

vicuna opened this issue Jul 25, 2002 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 25, 2002

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

Bug description

Full_Name: Berke Durak
Version: 3.04+15
OS: OpenBSD 2.9
Submission from: mix-montsouris-110-3-84.abo.wanadoo.fr (193.248.190.84)

As far as I understand, ``sscanf "%x"'' is supposed to convert
strings of the form [0-9a-f]+ to decimal, not strings of the form
0x[0-9a-f]+. However :

Scanf.sscanf "a" "%x" (fun x -> x);;

Exception:
Scanf.Scan_failure "scanf: bad input at char number 1: int_of_string".

Same bug applies for %lx, and possibly for %lo...

@vicuna
Copy link
Author

vicuna commented Jul 25, 2002

Comment author: administrator

As far as I understand, ``sscanf "%x"'' is supposed to convert
strings of the form [0-9a-f]+ to decimal, not strings of the form
0x[0-9a-f]+. However :

Scanf.sscanf "a" "%x" (fun x -> x);;

Exception:
Scanf.Scan_failure "scanf: bad input at char number 1: int_of_string".

Same bug applies for %lx, and possibly for %lo...

Thanks for reporting this bug. It is now fixed in the working
sources.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jul 25, 2002

Comment author: administrator

Fxied 2002-07-25 by DD & XL

@vicuna vicuna closed this as completed Jul 25, 2002
@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