2003-02-07 17:03:11

by James Lamanna

[permalink] [raw]
Subject: Scanf behavior

I was looking at addressing bug #189 on bugzilla which calls for scanf
to respect field_widths for numeric arguments (i.e. %2hd)
2 semantic issues I thought of:

1) Should the field width ignore any number modifiers ( '0x' for hex,
'0' for octal, '-' for negatives) ?
For example a field_width of 1 on the string "0x5F" should return 0 or
0x5
(I would think the latter is much more appropriate).

2) What about a field_width of 0? Always return 0?

Thanks,
--James