Fix: liblttng-ctl: unreported truncations when copying strings
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 12 Jan 2021 22:41:54 +0000 (17:41 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 13 Jan 2021 13:43:15 +0000 (08:43 -0500)
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 <jeremie.galarneau@efficios.com>
Change-Id: Icca5f4c2490c6796b451999d7694db8597bae719


No differences found
This page took 0.02445 seconds and 4 git commands to generate.