From: Jérémie Galarneau Date: Fri, 1 Jun 2018 17:01:42 +0000 (-0400) Subject: Silence strncpy warning emitted by GCC 8 in XSD path construction X-Git-Tag: v2.11.0-rc1~194 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=00a7f6f86d22b9130b32a026f0d355e670b0a0ff;p=lttng-tools.git Silence strncpy warning emitted by GCC 8 in XSD path construction The size of the XSD's path is fully determined in this function which makes strcpy() safe to use. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index 4d12870e8..01ae901ad 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -677,13 +677,12 @@ char *get_session_config_xsd_path() goto end; } - strncpy(xsd_path, base_path, max_path_len); + strcpy(xsd_path, base_path); if (xsd_path[base_path_len - 1] != '/') { xsd_path[base_path_len++] = '/'; } - strncpy(xsd_path + base_path_len, DEFAULT_SESSION_CONFIG_XSD_FILENAME, - max_path_len - base_path_len); + strcpy(xsd_path + base_path_len, DEFAULT_SESSION_CONFIG_XSD_FILENAME); end: return xsd_path; }