flash/nor/kinetis: fix clang scan-build error format-truncation
authorErhan Kurubas <erhan.kurubas@espressif.com>
Sun, 21 Aug 2022 18:57:32 +0000 (21:57 +0300)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 1 Sep 2022 10:22:29 +0000 (10:22 +0000)
kinetis.c:994:61: error: '%u' directive output may be truncated
writing between 1 and 10 bytes into a region of size 4
[-Werror=format-truncation=]

tested with scan-build-14

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I72d141a3f8e19ca3596beee2be8434fc8492946f
Reviewed-on: https://review.openocd.org/c/openocd/+/7140
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
src/flash/nor/kinetis.c

index 61e7b17abde73875b25a70ee50e0236669801d12..239cf416430a091413fef18da6bc65c71e97fc22 100644 (file)
@@ -948,7 +948,7 @@ static int kinetis_create_missing_banks(struct kinetis_chip *k_chip)
        unsigned num_blocks;
        struct kinetis_flash_bank *k_bank;
        struct flash_bank *bank;
-       char base_name[69], name[80], num[4];
+       char base_name[69], name[87], num[11];
        char *class, *p;
 
        num_blocks = k_chip->num_pflash_blocks + k_chip->num_nvm_blocks;