From c6d1e353bc4da793c032059a5cffec77b92d65f3 Mon Sep 17 00:00:00 2001 From: brarcher Date: Mon, 14 Oct 2013 23:03:25 +0000 Subject: [PATCH] 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 --- lib/snprintf.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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; } } -- 2.40.0