diff options
author | Richard Braun <rbraun@sceen.net> | 2017-06-11 00:48:00 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-06-11 00:48:00 +0200 |
commit | 7f72ab7149a63cdb012f2be9be170cbc7794dddf (patch) | |
tree | 9b6b5955899a4c7ba45f38832395f7e4f6c54783 /kern/fmt.c | |
parent | 3b02fcfb2d3df5f849b2544f3064d2ca346d319e (diff) |
kern/fmt: fix 0 and octal integer parsing
Diffstat (limited to 'kern/fmt.c')
-rw-r--r-- | kern/fmt.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1110,11 +1110,17 @@ fmt_sscanf_state_produce_int(struct fmt_sscanf_state *state) c = fmt_sscanf_state_consume_string(state); } else { fmt_sscanf_state_restore_string(state); + c = '0'; } } else { if (state->base == 0) { state->base = 8; } + + if (state->base != 8) { + fmt_sscanf_state_restore_string(state); + c = '0'; + } } } |