]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/mbsalign: abort() when non-expected case is encountered
authorSami Kerola <kerolasa@iki.fi>
Sat, 16 Jun 2012 21:09:54 +0000 (23:09 +0200)
committerSami Kerola <kerolasa@iki.fi>
Sun, 17 Jun 2012 15:59:59 +0000 (17:59 +0200)
Fixes the following compiler warning (9 occurrences), and makes program
to crash if mbsaligh() is called with unexpected align value (which
would be programming error).

../lib/mbsalign.c:260:7: warning: switch missing default case [-Wswitch-default]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/mbsalign.c

index 468e35b59f71b915ee27907e8ab0667b29a4cc41..d97bbd5ebb1819dd3377c13630c41d9c9c6eca07 100644 (file)
@@ -271,6 +271,8 @@ mbsalign_unibyte:
           start_spaces = n_spaces;
           end_spaces = 0;
           break;
+       default:
+         abort();
         }
 
       dest = mbs_align_pad (dest, dest_end, start_spaces);