summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-11 16:58:45 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-11 16:58:45 +0100
commiteccaf899331ecbe3807739b6356ebba3d71480c7 (patch)
tree7d9968c3ca604ded8b165b3463237d1822365e55 /src
parentf7340ab269828d917cd1281e33e6dd4fdfee67b3 (diff)
tree-wide: use our memset() macros instead of memset() itself
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/sd-icmp6-nd.c2
-rw-r--r--src/libsystemd-terminal/term-screen.c2
-rw-r--r--src/shared/hashmap.c6
-rw-r--r--src/test/test-pty.c2
-rw-r--r--src/test/test-ring.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/libsystemd-network/sd-icmp6-nd.c b/src/libsystemd-network/sd-icmp6-nd.c
index cb06151514..fbaf093ad8 100644
--- a/src/libsystemd-network/sd-icmp6-nd.c
+++ b/src/libsystemd-network/sd-icmp6-nd.c
@@ -87,7 +87,7 @@ int sd_icmp6_nd_set_mac(sd_icmp6_nd *nd, const struct ether_addr *mac_addr) {
if (mac_addr)
memcpy(&nd->mac_addr, mac_addr, sizeof(nd->mac_addr));
else
- memset(&nd->mac_addr, 0x00, sizeof(nd->mac_addr));
+ zero(nd->mac_addr);
return 0;
diff --git a/src/libsystemd-terminal/term-screen.c b/src/libsystemd-terminal/term-screen.c
index 51d93765e4..f021ffee23 100644
--- a/src/libsystemd-terminal/term-screen.c
+++ b/src/libsystemd-terminal/term-screen.c
@@ -3184,7 +3184,7 @@ static int screen_TBC(term_screen *screen, const term_seq *seq) {
break;
case 3:
if (screen->page->width > 0)
- memset(screen->tabs, 0, (screen->page->width + 7) / 8);
+ memzero(screen->tabs, (screen->page->width + 7) / 8);
break;
}
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index 5b329e0851..18c2c0ea3c 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -482,7 +482,7 @@ static unsigned skip_free_buckets(HashmapBase *h, unsigned idx) {
}
static void bucket_mark_free(HashmapBase *h, unsigned idx) {
- memset(bucket_at(h, idx), 0, hashmap_type_info[h->type].entry_size);
+ memzero(bucket_at(h, idx), hashmap_type_info[h->type].entry_size);
bucket_set_dib(h, idx, DIB_FREE);
}
@@ -1154,7 +1154,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) {
}
/* Zero the area of newly added entries (including the old DIB area) */
- memset(bucket_at(h, old_n_buckets), 0,
+ memzero(bucket_at(h, old_n_buckets),
(n_buckets(h) - old_n_buckets) * hi->entry_size);
/* The upper half of the new DIB array needs initialization */
@@ -1182,7 +1182,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) {
new_dibs[idx] = DIB_RAW_FREE;
bucket_move_entry(h, &swap, idx, IDX_PUT);
/* bucket_move_entry does not clear the source */
- memset(bucket_at(h, idx), 0, hi->entry_size);
+ memzero(bucket_at(h, idx), hi->entry_size);
do {
/*
diff --git a/src/test/test-pty.c b/src/test/test-pty.c
index ed23e9f0f1..cab569a9da 100644
--- a/src/test/test-pty.c
+++ b/src/test/test-pty.c
@@ -100,7 +100,7 @@ static void test_pty(void) {
Pty *pty;
rcvsiz = 0;
- memset(rcvbuf, 0, sizeof(rcvbuf));
+ zero(rcvbuf);
assert_se(sd_event_default(&event) >= 0);
diff --git a/src/test/test-ring.c b/src/test/test-ring.c
index 5e4efdbde9..a9dd01ca01 100644
--- a/src/test/test-ring.c
+++ b/src/test/test-ring.c
@@ -36,7 +36,7 @@ static void test_ring(void) {
struct iovec vec[2];
int s;
- memset(&r, 0, sizeof(r));
+ zero(r);
l = ring_peek(&r, vec);
assert_se(l == 0);