com php-src: Use memset instead of brace initialization: ext/sockets/multicast.c
| From: | Nikita Popov | Date: | Wed, 12 Jun 2019 11:50:23 +0000 |
| Subject: | com php-src: Use memset instead of brace initialization: ext/sockets/multicast.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106731@lists.php.net to get a copy of this message | ||
Commit: cdefeb715b7a91695407fefd59cdf93815dc0a90
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 12 Jun 2019 13:25:19 +0200
Parents: 945e5d35d77cf0a7a5cb9677c49fa0d15a549563
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cdefeb715b7a91695407fefd59cdf93815dc0a90
Log:
Use memset instead of brace initialization
Apparently {{0}} is not enough ... let's not rely on structure
layout specifics here.
Changed paths:
M ext/sockets/multicast.c
Diff:
diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c
index 2ede92b..e874803 100644
--- a/ext/sockets/multicast..c
+++ b/ext/sockets/multicast.c
@@ -463,8 +463,9 @@ static int _php_mcast_join_leave(
sizeof(greq));
#else
if (sock->type == AF_INET) {
- struct ip_mreq mreq = {{0}};
+ struct ip_mreq mreq;
struct in_addr addr;
+ memset(&mreq, 0, sizeof(struct ip_mreq));
assert(group_len == sizeof(struct sockaddr_in));
@@ -483,7 +484,8 @@ static int _php_mcast_join_leave(
}
#if HAVE_IPV6
else if (sock->type == AF_INET6) {
- struct ipv6_mreq mreq = {{0}};
+ struct ipv6_mreq mreq;
+ memset(&mreq, 0, sizeof(struct ipv6_mreq));
assert(group_len == sizeof(struct sockaddr_in6));