mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
tools: Fix memset(&p,0,sizeof(p)) idiom in several places.
gcc 4.8 identifies several places where code of the form memset(x, 0,
sizeof(x)); is used incorrectly, meaning that less memory is set to
zero than required.
Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Committed-by: Keir Fraser <keir@xen.org>
(cherry picked from commit d119301b58)
This commit is contained in:
1 parent
b5445b141f
commit
3f5e3cd973
6 files changed
+6
-6
No files matched your search
@@ -37,7 +37,7 @@ int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions,
|
||||
int sndbuf = 32768;
|
||||
int rcvbuf = 32768;
|
||||
|
||||
memset(rth, 0, sizeof(rth));
|
||||
memset(rth, 0, sizeof(*rth));
|
||||
|
||||
rth->fd = socket(AF_NETLINK, SOCK_RAW, protocol);
|
||||
if (rth->fd < 0) {
|
||||
|
||||