mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Ensure that strings are copied correctly by using util_strlcpy() rather than strncpy(). This fixes the following GCC8 compile warnings: sd_core.c: In function ‘sd_cpu_new’: sd_core.c:222:2: warning: ‘strncpy’ specified bound 9 equals destination size [-Wstringop-truncation] strncpy(cpu->id, id, sizeof(cpu->id)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sd_core.c: In function ‘sd_sys_new’: sd_core.c:254:2: warning: ‘strncpy’ specified bound 9 equals destination size [-Wstringop-truncation] strncpy(sys_new->id, id, sizeof(sys_new->id)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tbox.c:160:2: warning: ‘strncpy’ specified bound 121 equals destination size [-Wstringop-truncation] strncpy(line_cpy, line, sizeof(line_cpy)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ win_sys.c: In function ‘win_sys_set’: win_sys.c:329:2: warning: ‘strncpy’ specified bound 9 equals destination size [-Wstringop-truncation] strncpy(l_sys_id, sys_id, sizeof(l_sys_id)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
4.1 KiB
4.1 KiB