diff options
author | Greg KH <gregkh@linuxfoundation.org> | 2014-02-02 07:15:23 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-02-02 07:15:23 -0500 |
commit | 8fe035158681d0324ff2be99a67bc0434da6faad (patch) | |
tree | c9a82a131e2597a62ed392355e39dfc7a888da9d /src/libudev/libudev-monitor.c | |
parent | 7eefa0ad0db267d99448fcddff2aebb4ebc33f6f (diff) |
use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set). So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/libudev-monitor.c')
-rw-r--r-- | src/libudev/libudev-monitor.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index fa20a69e85..bd22741c66 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -291,7 +291,7 @@ _public_ int udev_monitor_filter_update(struct udev_monitor *udev_monitor) udev_list_get_entry(&udev_monitor->filter_tag_list) == NULL) return 0; - memset(ins, 0x00, sizeof(ins)); + memzero(ins, sizeof(ins)); i = 0; /* load magic in A */ @@ -371,7 +371,7 @@ _public_ int udev_monitor_filter_update(struct udev_monitor *udev_monitor) bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); /* install filter */ - memset(&filter, 0x00, sizeof(filter)); + memzero(&filter, sizeof(filter)); filter.len = i; filter.filter = ins; err = setsockopt(udev_monitor->sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)); @@ -599,7 +599,7 @@ retry: return NULL; iov.iov_base = &buf; iov.iov_len = sizeof(buf); - memset (&smsg, 0x00, sizeof(struct msghdr)); + memzero(&smsg, sizeof(struct msghdr)); smsg.msg_iov = &iov; smsg.msg_iovlen = 1; smsg.msg_control = cred_msg; @@ -744,7 +744,7 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, return -EINVAL; /* add versioned header */ - memset(&nlh, 0x00, sizeof(struct udev_monitor_netlink_header)); + memzero(&nlh, sizeof(struct udev_monitor_netlink_header)); memcpy(nlh.prefix, "libudev", 8); nlh.magic = htonl(UDEV_MONITOR_MAGIC); nlh.header_size = sizeof(struct udev_monitor_netlink_header); @@ -771,7 +771,7 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, iov[1].iov_base = (char *)buf; iov[1].iov_len = blen; - memset(&smsg, 0x00, sizeof(struct msghdr)); + memzero(&smsg, sizeof(struct msghdr)); smsg.msg_iov = iov; smsg.msg_iovlen = 2; /* |