From 3bb412e072048a19a98634766d66d5ce5b5c4a85 Mon Sep 17 00:00:00 2001 From: Jeroen Hofstee Date: Wed, 17 Aug 2022 16:51:43 +0200 Subject: [PATCH] lib: fix seperator in snprintf_error_data When multiple error flags are set, snprintf_error_data created a comma seperated textual presentation of it. Commit ef853f555379 ("added return value check of snprintf to prevent possible buffer overflows detected by CodeQL") removed the increment of count, so the delimiter is no longer added. Fix this by incrementing count again. Fixes: Commit ef853f555379 ("added return value check of snprintf to prevent possible buffer overflows detected by CodeQL") Signed-off-by: Jeroen Hofstee --- lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.c b/lib.c index 3c1a0d9..72afd79 100644 --- a/lib.c +++ b/lib.c @@ -582,6 +582,7 @@ static int snprintf_error_data(char *buf, size_t len, uint8_t err, return n; } n += tmp_n; + count++; } }