summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-13 15:48:43 +0100
committersin <sin@2f30.org>2014-09-13 15:48:43 +0100
commit0c4fe86bba0bbf32112388e62f2856dea218af1a (patch)
treec6af7a2556fcad3c3ca3a3e6a31056a45e5f7531
parentd0f4dccc6ac8b81db75930ccb2a22f556b54fa33 (diff)
Statically init friend head
-rw-r--r--ratatox.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ratatox.c b/ratatox.c
index 52ab03e..69154a2 100644
--- a/ratatox.c
+++ b/ratatox.c
@@ -112,7 +112,7 @@ struct friend {
TAILQ_ENTRY(friend) entry;
};
-static TAILQ_HEAD(friendhead, friend) friendhead;
+static TAILQ_HEAD(friendhead, friend) friendhead = TAILQ_HEAD_INITIALIZER(friendhead);
static Tox *tox;
static void dataload(void);
@@ -455,8 +455,6 @@ friendload(void)
int n;
char name[TOX_MAX_NAME_LENGTH + 1];
- TAILQ_INIT(&friendhead);
-
sz = tox_count_friendlist(tox);
fids = malloc(sz);
if (!fids) {