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:
Michael Young authored and Ian Jackson committed 2013-02-28 11:45:47 +00:00
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) {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.