diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-20 20:12:38 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-21 01:14:33 +0200 |
commit | 772270f3b6a37a2dd9432541cce436e9b45bb6b9 (patch) | |
tree | fc7f717a60d056b0300fcf43373a1fff30b94b13 /ripd/ripd.c | |
parent | tools: add more macros to cocci.h (diff) | |
download | frr-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 'ripd/ripd.c')
-rw-r--r-- | ripd/ripd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c index fee700583..f6db713cb 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2972,8 +2972,8 @@ static void rip_distance_show(struct vty *vty, struct rip *rip) " Address Distance List\n"); header = 0; } - sprintf(buf, "%s/%d", inet_ntoa(rn->p.u.prefix4), - rn->p.prefixlen); + snprintf(buf, sizeof(buf), "%s/%d", + inet_ntoa(rn->p.u.prefix4), rn->p.prefixlen); vty_out(vty, " %-20s %4d %s\n", buf, rdistance->distance, rdistance->access_list ? rdistance->access_list |