]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
col: add defaults to switch case clauses
authorSami Kerola <kerolasa@iki.fi>
Sun, 28 Jun 2020 16:08:47 +0000 (17:08 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 12 Sep 2020 17:32:55 +0000 (18:32 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/col.c

index 2cf6cb39e9869aa37e8f545087855090f7bb45b6..6488688193848afea69136fc587748c9f270801a 100644 (file)
@@ -291,6 +291,9 @@ static void flush_line(struct col_ctl *ctl, LINE *l)
                                        break;
                                case CS_ALTERNATE:
                                        col_putchar(SO);
+                                       break;
+                               default:
+                                       abort();
                                }
                                ctl->last_set = c->c_set;
                        }
@@ -379,6 +382,9 @@ static int handle_not_graphic(struct col_ctl *ctl, struct col_lines *lns)
                        lns->cur_line += 1;
                        if (0 < lns->cur_line && lns->max_line < (size_t)lns->cur_line)
                                lns->max_line = lns->cur_line;
+                       break;
+               default:
+                       break;
                }
                return 1;
        case NL:
@@ -403,6 +409,8 @@ static int handle_not_graphic(struct col_ctl *ctl, struct col_lines *lns)
        case VT:
                lns->cur_line -= 2;
                return 1;
+       default:
+               break;
        }
        if (iswspace(lns->ch)) {
                if (0 < wcwidth(lns->ch))