mirror of
https://github.com/radvd-project/radvd.git
synced 2025-12-20 01:11:37 +08:00
GCC8 added a warning for string truncation that fires on the interface name handling. Use the same fix as found in iproute2 to solve it, replacing `strncpy(dst, src, sz-1)` with `memset(dst, NULL, size)` and then `strlcpy(dst, src, sizeof(dst))`. `strlcpy` ensures NULL terminated strings in all cases where `strncpy` does not. Reference: https://patchwork.ozlabs.org/project/netdev/patch/20180319165638.30166-3-stephen@networkplumber.org/ Reference: https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
6.4 KiB
6.4 KiB