]> granicus.if.org Git - check/commitdiff
snprintf: remove missing default case warning
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 14 Oct 2013 23:03:25 +0000 (23:03 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 14 Oct 2013 23:03:25 +0000 (23:03 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@840 64e312b2-a51f-0410-8e61-82d0ca0eb02a

lib/snprintf.c

index f00569a8b70485646b846d37bf819ec723d11599..9446a80cee707312808236adad23dd0a8d7cfb54 100644 (file)
@@ -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;
                }
        }