From: Alain Spineux Date: Wed, 7 Jun 2023 09:48:40 +0000 (+0200) Subject: win32: tweak fix warning X-Git-Tag: Beta-15.0.0~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4eb91637daea7d3e47f6f8bfa03d166929fb5b2;p=thirdparty%2Fbacula.git win32: tweak fix warning - 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); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ --- 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)