summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@qlyoung.net>2021-02-07 22:39:42 -0500
committerQuentin Young <qlyoung@nvidia.com>2021-02-09 15:40:40 -0500
commit7533cad751eaeabe5626cad636aefa8bf50d7409 (patch)
tree866b7345bfbef16c3ae473aa997929598b61d45a /lib/vty.c
parent658186e8b6ad84bd92fa46201901cf75bf3174c2 (diff)
*: remove more sprintf()
Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
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 4062b183e7..66b607861c 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2414,9 +2414,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;