summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb632fa)
raw | patch | inline | side by side (parent: fb632fa)
author | Florian Forster <ff@octo.it> | |
Tue, 9 May 2017 06:40:33 +0000 (08:40 +0200) | ||
committer | Florian Forster <ff@octo.it> | |
Tue, 9 May 2017 06:40:33 +0000 (08:40 +0200) |
Also remove an unnecessary cast from void* to pingobj_t*.
src/liboping.c | patch | blob | history |
diff --git a/src/liboping.c b/src/liboping.c
index de82d5fde18544a4c3250c90267a4ace42d7b3f6..5a39633b6eab1d4e4cef7f104d5ae7c045948e5b 100644 (file)
--- a/src/liboping.c
+++ b/src/liboping.c
{
pingobj_t *obj;
- if ((obj = (pingobj_t *) malloc (sizeof (pingobj_t))) == NULL)
+ if ((obj = malloc (sizeof (*obj))) == NULL)
return (NULL);
- memset (obj, 0, sizeof (pingobj_t));
+ memset (obj, 0, sizeof (*obj));
obj->timeout = PING_DEF_TIMEOUT;
obj->ttl = PING_DEF_TTL;