summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kern/fmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kern/fmt.c b/kern/fmt.c
index 06284de..1c635e1 100644
--- a/kern/fmt.c
+++ b/kern/fmt.c
@@ -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';
+ }
}
}