summaryrefslogtreecommitdiffstats
path: root/lib/netns_linux.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-04-20 20:12:38 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-04-21 01:14:33 +0200
commit772270f3b6a37a2dd9432541cce436e9b45bb6b9 (patch)
treefc7f717a60d056b0300fcf43373a1fff30b94b13 /lib/netns_linux.c
parenttools: add more macros to cocci.h (diff)
downloadfrr-772270f3b6a37a2dd9432541cce436e9b45bb6b9.tar.xz
frr-772270f3b6a37a2dd9432541cce436e9b45bb6b9.zip
*: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/netns_linux.c')
-rw-r--r--lib/netns_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/netns_linux.c b/lib/netns_linux.c
index 4d4376250..98f359401 100644
--- a/lib/netns_linux.c
+++ b/lib/netns_linux.c
@@ -431,7 +431,7 @@ char *ns_netns_pathname(struct vty *vty, const char *name)
/* relevant pathname */
char tmp_name[PATH_MAX];
- snprintf(tmp_name, PATH_MAX, "%s/%s", NS_RUN_DIR, name);
+ snprintf(tmp_name, sizeof(tmp_name), "%s/%s", NS_RUN_DIR, name);
result = realpath(tmp_name, pathname);
}