[PATCH 1/2] vsprintf: fix missing break when printing %pJP
Jules Maselbas
jmaselbas at zdiv.net
Tue Mar 25 08:53:26 PDT 2025
When the format `%pJP` was introduced the new switch case didn't had a
break at the end, it was last case in the switch. However subsequent
commit didn't add a break either, creating a potential fallthrough.
Add the missing break.
Fixes: 107eeef8f2 ("vsprintf: add support for printing MAC addresses")
Signed-off-by: Jules Maselbas <jmaselbas at zdiv.net>
---
lib/vsprintf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index f553662ce8..0656ba3620 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -561,6 +561,7 @@ static char *pointer(const char *fmt, char *buf, const char *end, const void *pt
case 'J':
if (fmt[1] == 'P' && IS_ENABLED(CONFIG_JSMN))
return jsonpath_string(buf, end, ptr, field_width, precision, flags, fmt);
+ break;
case 'M':
/* Colon separated: 00:01:02:03:04:05 */
return mac_address_string(buf, end, ptr, field_width, precision, flags, fmt);
--
2.48.1
More information about the barebox
mailing list