summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-29 20:52:00 +0200
committerGitHub <noreply@github.com>2024-01-29 20:52:00 +0200
commitbb957e4c94d3a6799ed66319c22c34c4cccbf65e (patch)
treef3ee6f303cc136f736a220e03e2b5acbf7f8ef6e
parentf8755d7f866d4ae74d01b2ef9baa6829bdb99f63 (diff)
parenta403a71fbc8f6bd2934bd08e131dff6fbcc67108 (diff)
Merge pull request #15248 from LabNConsulting/chopps/fix-comp-warning
zebra: fix compiler warning about truncation.
-rw-r--r--zebra/zebra_cli.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/zebra_cli.c b/zebra/zebra_cli.c
index 296f03ae89..76b2df157e 100644
--- a/zebra/zebra_cli.c
+++ b/zebra/zebra_cli.c
@@ -230,11 +230,12 @@ DEFUN_YANG_NOSH (link_params,
ret = nb_cli_apply_changes(vty, NULL);
if (ret == CMD_SUCCESS) {
- char xpath[XPATH_MAXLEN];
+ char *xpath;
- snprintf(xpath, sizeof(xpath), "%s/frr-zebra:zebra/link-params",
- VTY_CURR_XPATH);
+ xpath = asprintfrr(MTYPE_TMP, "%s/frr-zebra:zebra/link-params",
+ VTY_CURR_XPATH);
VTY_PUSH_XPATH(LINK_PARAMS_NODE, xpath);
+ XFREE(MTYPE_TMP, xpath);
}
return ret;