From a4eb91637daea7d3e47f6f8bfa03d166929fb5b2 Mon Sep 17 00:00:00 2001 From: Alain Spineux Date: Wed, 7 Jun 2023 11:48:40 +0200 Subject: [PATCH] win32: tweak fix warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - sendit() already handle the final '\O' no need to include it in the len - fir warning: In file included from /home/bac/workspace/bee/bacula/src/stored/status.c:30: In function ‘void sendit(const char*, int, STATUS_PKT*)’, inlined from ‘void list_one_device(char*, DEVICE*, STATUS_PKT*, OutputWriter*)’ at /home/bac/workspace/bee/bacula/src/stored/status.c:407:24, inlined from ‘void list_devices(STATUS_PKT*, char*)’ at /home/bac/workspace/bee/bacula/src/stored/status.c:498:25: /home/bac/workspace/bee/bacula/src/lib/status.h:46:13: warning: ‘void* memcpy(void*, const void*, size_t)’ forming offset 4 is out of the bounds [0, 4] [-Warray-bounds] 46 | memcpy(user->msg, msg, len+1); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ --- bacula/src/stored/status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index 2e5f32122..0ce19f5bb 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -325,7 +325,7 @@ static void list_one_device(char *name, DEVICE *dev, STATUS_PKT *sp, OutputWrite len = Mmsg(msg, _("\nDevice \"%s\" is not open or does not exist.\n"), name); sendit(msg, len, sp); - if (!sp->api) sendit("==\n", 4, sp); + if (!sp->api) sendit("==\n", 3, sp); return; } @@ -406,7 +406,7 @@ static void list_one_device(char *name, DEVICE *dev, STATUS_PKT *sp, OutputWrite dev->show_tape_alerts((DCR *)sp, list_short, list_all, status_alert_callback); - if (!sp->api) sendit("==\n", 4, sp); + if (!sp->api) sendit("==\n", 3, sp); } static void list_one_autochanger(char *name, AUTOCHANGER *changer, STATUS_PKT *sp, OutputWriter *ow) -- 2.47.3