Fix printing of route src mask attribute when it contains 3 digits
Signed-off-by: Hans Dedecker <[email protected]>
---
ubus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ubus.c b/ubus.c
index 22b75e4..d876824 100644
--- a/ubus.c
+++ b/ubus.c
@@ -497,7 +497,7 @@ interface_ip_dump_route_list(struct interface_ip_settings
*ip, bool enabled)
buf = blobmsg_alloc_string_buffer(&b, "source", buflen);
inet_ntop(af, &route->source, buf, buflen);
- snprintf(buf + strlen(buf), 4, "/%u", route->sourcemask);
+ snprintf(buf + strlen(buf), buflen - strlen(buf), "/%u",
route->sourcemask);
blobmsg_add_string_buffer(&b);
blobmsg_close_table(&b, r);
--
1.7.1
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel