lttng: clean-up: silence bogus string truncation warning
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 20:43:38 +0000 (16:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 20:43:38 +0000 (16:43 -0400)
commitbfe363931d42c68767ebb096f5958b3b1dfde3bb
tree7ac96101ab9616e727e7ef7ca9427a59c5b56b5b
parentabda88ad06a238652230a7d19f0775a7a75d3dc4
lttng: clean-up: silence bogus string truncation warning

gcc 9.1.0 reports
enable_events.c:827:2: warning: ‘strncpy’ output truncated copying 9 bytes from a string of length 11 [-Wstringop-truncation]
  827 |  strncpy(ret, preamble, length);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc seems confused and using "sizeof" the preamble seems to make
it understand the code flow and not generate the warning anymore.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/enable_events.c
This page took 0.024998 seconds and 4 git commands to generate.