From a403a71fbc8f6bd2934bd08e131dff6fbcc67108 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Mon, 29 Jan 2024 08:18:01 -0500 Subject: [PATCH] zebra: fix compiler warning about truncation. Signed-off-by: Christian Hopps --- zebra/zebra_cli.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_cli.c b/zebra/zebra_cli.c index 296f03ae892e..76b2df157e40 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;