- 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);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
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;
}
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)