From 3152dd4b62443edbd884f3d8a90b7b61e5be0e4b 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.x warnings Signed-off-by: Bernhard Rosenkränzer --- tools/doimage/doimage.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/doimage/doimage.c b/tools/doimage/doimage.c index 39ed9911c3..67b11d47f0 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; @@ -1437,9 +1437,9 @@ 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 ext_file[MAX_FILENAME]; + char in_file[MAX_FILENAME+1]; + char out_file[MAX_FILENAME+1]; + char ext_file[MAX_FILENAME+1]; FILE *in_fd = NULL; FILE *out_fd = NULL; int parse = 0;