From a363cb9b9111aed22d105adb0e7a8e9caab9bbe3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 17 Feb 2013 09:01:46 +0100 Subject: Fix braces in if-else statements From the Linux kernel coding guidelines: Do not unnecessarily use braces where a single statement will do. [...] This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. Signed-off-by: Lukas Fleischer --- src/getstring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/getstring.c') diff --git a/src/getstring.c b/src/getstring.c index 3b7224d..aedd842 100644 --- a/src/getstring.c +++ b/src/getstring.c @@ -193,8 +193,9 @@ enum getstr getstring(WINDOW * win, char *str, int l, int x, int y) if (st.pos > 0) { st.pos--; getstr_del_char(&st); - } else + } else { bell(); + } break; case CTRL('D'): /* delete next character */ if (st.pos < st.len) @@ -212,8 +213,9 @@ enum getstr getstring(WINDOW * win, char *str, int l, int x, int y) st.pos--; getstr_del_char(&st); } - } else + } else { bell(); + } break; case CTRL('K'): /* delete to end-of-line */ st.s[st.ci[st.pos].offset] = 0; -- cgit v1.2.3