From 00603bf15638347256b1c330bafbeaef0d4d8287 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sat, 27 May 2023 15:56:44 +0200 Subject: [PATCH] flash: psoc4: fix clang error Clang 15.0.7 complains about snprintf output truncation due to output between 13 and 22 bytes into a destination of size 20. Increase the size of the buffer. Change-Id: I0369255ca1bc02a0cf494f765e91a608c960a0d6 Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/7717 Tested-by: jenkins --- src/flash/nor/psoc4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flash/nor/psoc4.c b/src/flash/nor/psoc4.c index fb462c1e5..1064fa93d 100644 --- a/src/flash/nor/psoc4.c +++ b/src/flash/nor/psoc4.c @@ -779,7 +779,7 @@ static int psoc4_probe(struct flash_bank *bank) flash_size_in_kb = psoc4_info->user_bank_size / 1024; } - char macros_txt[20] = ""; + char macros_txt[22] = ""; if (num_macros > 1) snprintf(macros_txt, sizeof(macros_txt), " in %" PRIu32 " macros", num_macros);