mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] vsprintf: fix missing break when printing %pJP
@ 2025-03-25 15:53 Jules Maselbas
  2025-03-25 15:53 ` [PATCH 2/2] vsprintf: add explicit fallthrough Jules Maselbas
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jules Maselbas @ 2025-03-25 15:53 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas

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@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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-27  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-25 15:53 [PATCH 1/2] vsprintf: fix missing break when printing %pJP Jules Maselbas
2025-03-25 15:53 ` [PATCH 2/2] vsprintf: add explicit fallthrough Jules Maselbas
2025-03-25 16:58 ` [PATCH 1/2] vsprintf: fix missing break when printing %pJP Ahmad Fatoum
2025-03-27  7:38 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox