summaryrefslogtreecommitdiffstats
path: root/babeld/babel_interface.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 /babeld/babel_interface.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 'babeld/babel_interface.c')
-rw-r--r--babeld/babel_interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..f5dc89ee2 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -971,7 +971,7 @@ show_babel_routes_sub(struct babel_route *route, struct vty *vty,
channels[0] = '\0';
else {
int k, j = 0;
- snprintf(channels, 100, " chan (");
+ snprintf(channels, sizeof(channels), " chan (");
j = strlen(channels);
for(k = 0; k < DIVERSITY_HOPS; k++) {
if(route->channels[k] == 0)