From: Arne Schwabe <[email protected]> - Replace bzero with CLEAR/memset
memset is nowadays preferred to bzero - add_route_ipv6: Fix %d used with unsigned int - add const to two variables that can be const Found-By: cppcheck on macOS Change-Id: I10ebb5821829bf738e58fec23f9f9dd65d4626d3 Signed-off-by: Arne Schwabe <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2014 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2014 This mail reflects revision 2 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Gert Doering <[email protected]> diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 8e93404..0b1634c 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1862,7 +1862,7 @@ #elif defined(TARGET_ANDROID) char out[64]; - snprintf(out, sizeof(out), "%s/%d %s", network, r6->netbits, device); + snprintf(out, sizeof(out), "%s/%u %s", network, r6->netbits, device); status = management_android_control(management, "ROUTE6", out); @@ -3348,10 +3348,10 @@ rtm_addrs = RTA_DST | RTA_NETMASK | RTA_IFP; #endif - bzero(&m_rtmsg, sizeof(m_rtmsg)); - bzero(&so_dst, sizeof(so_dst)); - bzero(&so_mask, sizeof(so_mask)); - bzero(&rtm, sizeof(struct rt_msghdr)); + CLEAR(m_rtmsg); + CLEAR(so_dst); + CLEAR(so_mask); + CLEAR(rtm); rtm.rtm_type = RTM_GET; rtm.rtm_flags = RTF_UP | RTF_GATEWAY; @@ -3566,10 +3566,10 @@ rtm_addrs = RTA_DST | RTA_NETMASK | RTA_IFP; #endif - bzero(&m_rtmsg, sizeof(m_rtmsg)); - bzero(&so_dst, sizeof(so_dst)); - bzero(&so_mask, sizeof(so_mask)); - bzero(&rtm, sizeof(struct rt_msghdr)); + CLEAR(m_rtmsg); + CLEAR(so_dst); + CLEAR(so_mask); + CLEAR(rtm); rtm.rtm_type = RTM_GET; rtm.rtm_flags = RTF_UP; @@ -3654,7 +3654,7 @@ /* get gateway addr and interface name */ if (gate != NULL) { - struct sockaddr_in6 *s6 = (struct sockaddr_in6 *)gate; + const struct sockaddr_in6 *s6 = (struct sockaddr_in6 *)gate; struct in6_addr gw = s6->sin6_addr; #ifndef TARGET_SOLARIS diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index a226fc4..18c1cff 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1833,7 +1833,7 @@ for (int i = 0; i < 256; ++i) { /* some platforms have a dedicated directory per driver */ - char *sep = ""; + const char *sep = ""; #if defined(TARGET_HAIKU) sep = "/"; #endif _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
