summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-02-23 15:55:02 -0500
committerGitHub <noreply@github.com>2021-02-23 15:55:02 -0500
commit15869cd81d346b5ebfcd2540012d7cb599729bd5 (patch)
tree909cea87cf6af4eaab9251a92513d8a1a22746f6 /lib/vty.c
parent33d1282f3d45d59517fb532ec6a60bdf27faecda (diff)
parent7533cad751eaeabe5626cad636aefa8bf50d7409 (diff)
Merge pull request #8035 from qlyoung/remove-more-sprintf
*: remove more sprintf()
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 65f8d78a96..df518422f0 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2427,9 +2427,9 @@ bool vty_read_config(struct nb_config *config, const char *config_file,
__func__, errno);
goto tmp_free_and_out;
}
- tmp = XMALLOC(MTYPE_TMP,
- strlen(cwd) + strlen(config_file) + 2);
- sprintf(tmp, "%s/%s", cwd, config_file);
+ size_t tmp_len = strlen(cwd) + strlen(config_file) + 2;
+ tmp = XMALLOC(MTYPE_TMP, tmp_len);
+ snprintf(tmp, tmp_len, "%s/%s", cwd, config_file);
fullpath = tmp;
} else
fullpath = config_file;