summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4442437)
raw | patch | inline | side by side (parent: 4442437)
author | Florian Forster <ff@octo.it> | |
Thu, 4 May 2017 12:07:31 +0000 (14:07 +0200) | ||
committer | Florian Forster <ff@octo.it> | |
Thu, 4 May 2017 12:07:31 +0000 (14:07 +0200) |
src/oping.c | patch | blob | history |
diff --git a/src/oping.c b/src/oping.c
index 9ac87bf6f9ce7c0f183b7f50f0aa0eb1445a3417..adf769fbac969f34cfdcc1d959df016ddf0a6dbe 100644 (file)
--- a/src/oping.c
+++ b/src/oping.c
opt_count = 0;
} /* }}} void sigint_handler */
-static ping_context_t *context_create (void) /* {{{ */
+static ping_context_t *context_create () /* {{{ */
{
- ping_context_t *ret;
-
- if ((ret = malloc (sizeof (ping_context_t))) == NULL)
+ ping_context_t *ctx = calloc (1, sizeof (*ctx));
+ if (ctx == NULL)
return (NULL);
- memset (ret, '\0', sizeof (ping_context_t));
-
- ret->latency_total = 0.0;
-
#if USE_NCURSES
- ret->window = NULL;
+ ctx->window = NULL;
#endif
- return (ret);
+ return (ctx);
} /* }}} ping_context_t *context_create */
static void context_destroy (ping_context_t *context) /* {{{ */