From: Jérémie Galarneau Date: Tue, 12 Jan 2021 22:41:54 +0000 (-0500) Subject: Fix: liblttng-ctl: unreported truncations when copying strings X-Git-Tag: v2.13.0-rc1~375 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=e1b624d005769d1a2e9eb39fee63c73c6395fd76;hp=e1b624d005769d1a2e9eb39fee63c73c6395fd76 Fix: liblttng-ctl: unreported truncations when copying strings gcc 10.2 reports a large number of string truncation warning in liblttng-ctl. Replace the uses of lttng_ctl_copy_string() util by lttng_strncpy() (handling the null source case when applicable) and report the truncations when they occur. Example gcc warning: lttng-ctl.c:86:3: warning: ‘strncpy’ output may be truncated copying 254 bytes from a string of length 254 [-Wstringop-truncation] Signed-off-by: Jérémie Galarneau Change-Id: Icca5f4c2490c6796b451999d7694db8597bae719 ---