From 8374b98e18766534c13baad8bf829d17a73669bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Wed, 2 May 2018 14:01:12 +0200 Subject: [PATCH] Leave space for trailing \0 after MAX_FILENAME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detected by gcc 8.0.1 warnings Signed-off-by: Bernhard Rosenkränzer --- tools/doimage/doimage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/doimage/doimage.c b/tools/doimage/doimage.c index f8fe1948c1..e491078ea4 100644 --- a/tools/doimage/doimage.c +++ b/tools/doimage/doimage.c @@ -171,8 +171,8 @@ typedef struct _sec_options { } sec_options; typedef struct _options { - char bin_ext_file[MAX_FILENAME]; - char sec_cfg_file[MAX_FILENAME]; + char bin_ext_file[MAX_FILENAME+1]; + char sec_cfg_file[MAX_FILENAME+1]; sec_options *sec_opts; uint32_t load_addr; uint32_t exec_addr; @@ -1439,8 +1439,8 @@ int write_boot_image(uint8_t *buf, uint32_t image_size, FILE *out_fd) int main(int argc, char *argv[]) { - char in_file[MAX_FILENAME]; - char out_file[MAX_FILENAME]; + char in_file[MAX_FILENAME+1]; + char out_file[MAX_FILENAME+1]; FILE *in_fd = NULL; FILE *out_fd = NULL; int parse = 0;