diff options
author | drkhsh <me@drkhsh.at> | 2022-10-28 00:51:34 +0200 |
---|---|---|
committer | drkhsh <me@drkhsh.at> | 2022-10-28 01:03:38 +0200 |
commit | 6c3cd320737419cc5e936a60f0f501b1edfa2ecf (patch) | |
tree | dc9b6927e963a994286babd803357615c9b37a22 /components/keyboard_indicators.c | |
parent | 0c8ac6edf9ad50506465db3fb70535ab561e6872 (diff) |
radical re-formatting 2/3: Fix blocks
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
Diffstat (limited to 'components/keyboard_indicators.c')
-rw-r--r-- | components/keyboard_indicators.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/components/keyboard_indicators.c b/components/keyboard_indicators.c index 4a81539..5f62bb7 100644 --- a/components/keyboard_indicators.c +++ b/components/keyboard_indicators.c @@ -33,17 +33,18 @@ keyboard_indicators(const char *fmt) fmtlen = strnlen(fmt, 4); for (i = n = 0; i < fmtlen; i++) { key = tolower(fmt[i]); - if (key != 'c' && key != 'n') { + if (key != 'c' && key != 'n') continue; - } + togglecase = (i + 1 >= fmtlen || fmt[i + 1] != '?'); isset = (state.led_mask & (1 << (key == 'n'))); - if (togglecase) { + + if (togglecase) buf[n++] = isset ? toupper(key) : key; - } else if (isset) { + else if (isset) buf[n++] = fmt[i]; - } } + buf[n] = 0; return buf; } |