From cbf0874f018c6ddd831de26b1ac5bcf7b517e2da Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 May 2009 00:01:50 +0200 Subject: memset: replace memset() by _DBUS_ZERO where applicable --- bus/desktop-file.c | 2 +- dbus/dbus-md5.c | 2 +- dbus/dbus-sha.c | 2 +- dbus/dbus-sysdeps-unix.c | 8 ++++---- dbus/dbus-sysdeps-win.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bus/desktop-file.c b/bus/desktop-file.c index 2ba77292..e925b2ea 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -330,7 +330,7 @@ new_line (BusDesktopFileParser *parser) line = §ion->lines[section->n_lines++]; - memset (line, 0, sizeof (BusDesktopFileLine)); + _DBUS_ZERO(*line); return line; } diff --git a/dbus/dbus-md5.c b/dbus/dbus-md5.c index 589c8d2a..8405f360 100644 --- a/dbus/dbus-md5.c +++ b/dbus/dbus-md5.c @@ -451,7 +451,7 @@ _dbus_md5_final (DBusMD5Context *context, /* some kind of security paranoia, though it seems pointless * to me given the nonzeroed stuff flying around */ - memset ((void*)context, '\0', sizeof (DBusMD5Context)); + _DBUS_ZERO(*context); return TRUE; } diff --git a/dbus/dbus-sha.c b/dbus/dbus-sha.c index 8ec50b6f..eb3439f8 100644 --- a/dbus/dbus-sha.c +++ b/dbus/dbus-sha.c @@ -465,7 +465,7 @@ _dbus_sha_final (DBusSHAContext *context, /* some kind of security paranoia, though it seems pointless * to me given the nonzeroed stuff flying around */ - memset ((void*)context, '\0', sizeof (DBusSHAContext)); + _DBUS_ZERO(*context); return TRUE; } diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 3312bd17..07db1c5f 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1382,13 +1382,13 @@ write_credentials_byte (int server_fd, iov.iov_base = buf; iov.iov_len = 1; - memset (&msg, 0, sizeof (msg)); + _DBUS_ZERO(msg); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = &cmsg; msg.msg_controllen = sizeof (cmsg); - memset (&cmsg, 0, sizeof (cmsg)); + _DBUS_ZERO(cmsg); cmsg.hdr.cmsg_len = sizeof (cmsg); cmsg.hdr.cmsg_level = SOL_SOCKET; cmsg.hdr.cmsg_type = SCM_CREDS; @@ -1498,12 +1498,12 @@ _dbus_read_credentials_socket (int client_fd, iov.iov_base = &buf; iov.iov_len = 1; - memset (&msg, 0, sizeof (msg)); + _DBUS_ZERO(msg); msg.msg_iov = &iov; msg.msg_iovlen = 1; #if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS) - memset (&cmsg, 0, sizeof (cmsg)); + _DBUS_ZERO(cmsg); msg.msg_control = &cmsg; msg.msg_controllen = sizeof (cmsg); #endif diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index a67e502a..507f2c00 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -2616,7 +2616,7 @@ static void dump_backtrace_for_thread(HANDLE hThread) DPRINTF("Backtrace:\n"); - memset(&context, 0, sizeof(context)); + _DBUS_ZERO(context); context.ContextFlags = CONTEXT_FULL; SuspendThread(hThread); @@ -2628,7 +2628,7 @@ static void dump_backtrace_for_thread(HANDLE hThread) return; } - memset(&sf, 0, sizeof(sf)); + _DBUS_ZERO(sf); #ifdef __i386__ sf.AddrFrame.Offset = context.Ebp; -- cgit