projects
/
liboping.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb632fa
)
src/liboping.c: Use sizeof(*ptr) instead of sizeof(type_t).
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
de82d5f
..
5a39633
100644
(file)
--- a/
src/liboping.c
+++ b/
src/liboping.c
@@
-1123,9
+1123,9
@@
pingobj_t *ping_construct (void)
{
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;