diff options
Diffstat (limited to 'lib/fmt.c')
-rw-r--r-- | lib/fmt.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2017 Richard Braun. + * Copyright (c) 2010-2018 Richard Braun. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -338,6 +338,7 @@ fmt_sprintf_state_consume_modifier(struct fmt_sprintf_state *state) break; case 'z': state->modifier = FMT_MODIFIER_SIZE; + __fallthrough; case 't': state->modifier = FMT_MODIFIER_PTRDIFF; break; @@ -359,6 +360,7 @@ fmt_sprintf_state_consume_specifier(struct fmt_sprintf_state *state) case 'd': case 'i': state->flags |= FMT_FORMAT_CONV_SIGNED; + __fallthrough; case 'u': state->base = 10; state->specifier = FMT_SPECIFIER_INT; @@ -370,8 +372,10 @@ fmt_sprintf_state_consume_specifier(struct fmt_sprintf_state *state) case 'p': state->flags |= FMT_FORMAT_ALT_FORM; state->modifier = FMT_MODIFIER_PTR; + __fallthrough; case 'x': state->flags |= FMT_FORMAT_LOWER; + __fallthrough; case 'X': state->base = 16; state->specifier = FMT_SPECIFIER_INT; @@ -674,8 +678,6 @@ fmt_sprintf_state_produce_str(struct fmt_sprintf_state *state) s = "(null)"; } - len = 0; - for (len = 0; s[len] != '\0'; len++) { if (len == state->precision) { break; @@ -1023,6 +1025,7 @@ fmt_sscanf_state_consume_specifier(struct fmt_sscanf_state *state) break; case 'd': state->flags |= FMT_FORMAT_CONV_SIGNED; + __fallthrough; case 'u': state->base = 10; state->specifier = FMT_SPECIFIER_INT; @@ -1033,6 +1036,7 @@ fmt_sscanf_state_consume_specifier(struct fmt_sscanf_state *state) break; case 'p': state->modifier = FMT_MODIFIER_PTR; + __fallthrough; case 'x': case 'X': state->base = 16; |