diff options
author | David Lamparter <equinox@diac24.net> | 2021-03-26 19:14:24 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2021-03-27 16:56:56 +0100 |
commit | eba599a39756b3d9424467f1e1f4f4475dffad17 (patch) | |
tree | 9685d22c152d27ec485016aaeea7354e15c3f657 /lib/prefix.c | |
parent | lib: rework printfrr extensions to output directly (diff) | |
download | frr-eba599a39756b3d9424467f1e1f4f4475dffad17.tar.xz frr-eba599a39756b3d9424467f1e1f4f4475dffad17.zip |
lib: print `(null)` rather than `NULL`
... for consistency with `%s`, which also prints `(null)`.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/prefix.c')
-rw-r--r-- | lib/prefix.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 169e9ed57..fba26a5b6 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -1368,7 +1368,7 @@ static ssize_t printfrr_ea(struct fbuf *buf, const char **fmt, char cbuf[ETHER_ADDR_STRLEN]; if (!mac) - return bputs(buf, "NULL"); + return bputs(buf, "(null)"); /* need real length even if buffer is too short */ prefix_mac2str(mac, cbuf, sizeof(cbuf)); @@ -1383,7 +1383,7 @@ static ssize_t printfrr_ia(struct fbuf *buf, const char **fmt, char cbuf[INET6_ADDRSTRLEN]; if (!ipa) - return bputs(buf, "NULL"); + return bputs(buf, "(null)"); ipaddr2str(ipa, cbuf, sizeof(cbuf)); return bputs(buf, cbuf); @@ -1396,7 +1396,7 @@ static ssize_t printfrr_i4(struct fbuf *buf, const char **fmt, char cbuf[INET_ADDRSTRLEN]; if (!ptr) - return bputs(buf, "NULL"); + return bputs(buf, "(null)"); inet_ntop(AF_INET, ptr, cbuf, sizeof(cbuf)); return bputs(buf, cbuf); @@ -1409,7 +1409,7 @@ static ssize_t printfrr_i6(struct fbuf *buf, const char **fmt, char cbuf[INET6_ADDRSTRLEN]; if (!ptr) - return bputs(buf, "NULL"); + return bputs(buf, "(null)"); inet_ntop(AF_INET6, ptr, cbuf, sizeof(cbuf)); return bputs(buf, cbuf); @@ -1422,7 +1422,7 @@ static ssize_t printfrr_pfx(struct fbuf *buf, const char **fmt, char cbuf[PREFIX_STRLEN]; if (!ptr) - return bputs(buf, "NULL"); + return bputs(buf, "(null)"); prefix2str(ptr, cbuf, sizeof(cbuf)); return bputs(buf, cbuf); @@ -1436,7 +1436,7 @@ static ssize_t printfrr_psg(struct fbuf *buf, const char **fmt, ssize_t ret = 0; if (!sg) - return bputs(buf, "NULL"); + return bputs(buf, "(null)"); if (sg->src.s_addr == INADDR_ANY) ret += bputs(buf, "(*,"); |