From: brarcher Date: Mon, 14 Oct 2013 23:03:25 +0000 (+0000) Subject: snprintf: remove missing default case warning X-Git-Tag: 0.10.0~374 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6d1e353bc4da793c032059a5cffec77b92d65f3;p=check snprintf: remove missing default case warning git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@840 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/lib/snprintf.c b/lib/snprintf.c index f00569a..9446a80 100644 --- a/lib/snprintf.c +++ b/lib/snprintf.c @@ -690,6 +690,9 @@ rpl_vsnprintf(char *str, size_t size, const char *format, va_list args) cflags = PRINT_C_SIZE; ch = *format++; break; + default: + /* Lenght modifier is invalid */ + break; } state = PRINT_S_CONV; break; @@ -914,6 +917,9 @@ rpl_vsnprintf(char *str, size_t size, const char *format, va_list args) base = cflags = flags = width = 0; precision = -1; break; + default: + /* This is an invalid state, should not get here */ + break; } out: if (len < size) @@ -1008,6 +1014,9 @@ fmtint(char *str, size_t *len, size_t size, INTMAX_T value, int base, int width, case 16: hexprefix = (flags & PRINT_F_UP) ? 'X' : 'x'; break; + default: + /* Invalid base */ + break; } }