[ 8s] In file included from /usr/include/string.h:494,
[ 8s] from /home/abuild/rpmbuild/BUILD/libsyscommon-4.1/src/libgdbus/dbus-systemd.c:21:
[ 8s] In function 'strncpy',
[ 8s] inlined from 'systemd_get_unit_dbus_path' at /home/abuild/rpmbuild/BUILD/libsyscommon-4.1/src/libgdbus/dbus-systemd.c:386:2:
[ 8s] /usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' output truncated before terminating nul copying 31 bytes from a string of the same length [-Wstringop-truncation]
[ 8s] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
Change-Id: Iaf5f71d7c364db91b495f50e63005778765ba359
if (!path)
return NULL;
- strncpy(path, SYSTEMD_DBUS_UNIT_PATH, prefix_len);
+ strncpy(path, SYSTEMD_DBUS_UNIT_PATH, prefix_len + 1);
for (i = 0, p = 0; i <= escape; i++) {
k = strcspn(unit + p, SYSTEMD_UNIT_ESCAPE_CHAR);
strncpy(path + prefix_len, unit + p, k);