Silence strncpy warning emitted by GCC 8 in XSD path construction
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 1 Jun 2018 17:01:42 +0000 (13:01 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 1 Jun 2018 17:03:02 +0000 (13:03 -0400)
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 <jeremie.galarneau@efficios.com>
src/common/config/session-config.c

index 4d12870e8d9bdd469cca73cf5cea127ec9f317f6..01ae901ad8c35a168611552f4346e1a649bfebe3 100644 (file)
@@ -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;
 }
This page took 0.027813 seconds and 5 git commands to generate.