diff options
author | Soby Mathew <soby.mathew@arm.com> | 2018-10-03 15:36:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 15:36:37 +0100 |
commit | 3ed87a496adb58605c4ea89c03688b6a08c5f0b0 (patch) | |
tree | 23bf112f61b4056ca93789607f1f2b22920b6b4f /lib | |
parent | a4277cda5c7f57a7205f4c29edbb488d518c29b5 (diff) | |
parent | a08a2014300a495381cdb8f6d59523bcd5d3b883 (diff) | |
download | platform_external_arm-trusted-firmware-3ed87a496adb58605c4ea89c03688b6a08c5f0b0.tar.gz platform_external_arm-trusted-firmware-3ed87a496adb58605c4ea89c03688b6a08c5f0b0.tar.bz2 platform_external_arm-trusted-firmware-3ed87a496adb58605c4ea89c03688b6a08c5f0b0.zip |
Merge pull request #1584 from danielboulby-arm/db/Switches
Ensure the flow through switch statements is clear
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/printf.c | 1 | ||||
-rw-r--r-- | lib/libc/snprintf.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/printf.c b/lib/libc/printf.c index 4480e94db..d50876d75 100644 --- a/lib/libc/printf.c +++ b/lib/libc/printf.c @@ -166,6 +166,7 @@ loop: padn = (padn * 10) + (ch - '0'); fmt++; } + assert(0); /* Unreachable */ default: /* Exit on any other format specifier */ return -1; diff --git a/lib/libc/snprintf.c b/lib/libc/snprintf.c index 9bc07b2cb..66a2fa2f5 100644 --- a/lib/libc/snprintf.c +++ b/lib/libc/snprintf.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <assert.h> #include <debug.h> #include <platform.h> #include <stdarg.h> @@ -117,6 +118,7 @@ int snprintf(char *s, size_t n, const char *fmt, ...) ERROR("snprintf: specifier with ASCII code '%d' not supported.", *fmt); plat_panic_handler(); + assert(0); /* Unreachable */ } fmt++; continue; |