diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2019-05-29 23:55:17 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-29 23:55:17 -0300 |
| commit | 0ad79902fc5f4219feef1fec2ee7b5dfd3f34f98 (patch) | |
| tree | 603415acae0525e1e09f1a0a2a0c362766783ab3 /zebra/ioctl.c | |
| parent | fc37d4fe0d22aafcaac0c71cc41e426ef7b8a71d (diff) | |
| parent | 67c726a10d90b9edc02e99e5a9064d14f9920309 (diff) | |
Merge pull request #4267 from qlyoung/fix-misc-compile-warnings
Fix misc compile warnings, remove strcpy & strcat
Diffstat (limited to 'zebra/ioctl.c')
| -rw-r--r-- | zebra/ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/ioctl.c b/zebra/ioctl.c index 322527015b..8202e076af 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -245,7 +245,7 @@ static int if_set_prefix_ctx(const struct zebra_dplane_ctx *ctx) p = (struct prefix_ipv4 *)dplane_ctx_get_intf_addr(ctx); memset(&addreq, 0, sizeof(addreq)); - strncpy((char *)&addreq.ifra_name, dplane_ctx_get_ifname(ctx), + strlcpy((char *)&addreq.ifra_name, dplane_ctx_get_ifname(ctx), sizeof(addreq.ifra_name)); memset(&addr, 0, sizeof(struct sockaddr_in)); @@ -296,7 +296,7 @@ static int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx) p = (struct prefix_ipv4 *)dplane_ctx_get_intf_addr(ctx); memset(&addreq, 0, sizeof(addreq)); - strncpy((char *)&addreq.ifra_name, dplane_ctx_get_ifname(ctx), + strlcpy((char *)&addreq.ifra_name, dplane_ctx_get_ifname(ctx), sizeof(addreq.ifra_name)); memset(&addr, 0, sizeof(struct sockaddr_in)); |
