From 5c98c1c51e70882fb7aeb0aa28131f369a2ddcf1 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 27 Jan 2015 18:00:25 -0500 Subject: [PATCH] group invite API change --- src/chat.c | 5 +++-- src/friendlist.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chat.c b/src/chat.c index 4d3481a..e8a3ade 100644 --- a/src/chat.c +++ b/src/chat.c @@ -567,9 +567,10 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, co if (self->num != friendnumber) return; - if (length != TOX_GROUP_INVITE_DATA_SIZE) - return; + if (Friends.list[friendnumber].group_invite.data) + free(Friends.list[friendnumber].group_invite.data); + Friends.list[friendnumber].group_invite.data = malloc(length * sizeof(uint8_t)); memcpy(Friends.list[friendnumber].group_invite.data, invite_data, length); Friends.list[friendnumber].group_invite.length = length; diff --git a/src/friendlist.h b/src/friendlist.h index ae4e965..d1e7f58 100644 --- a/src/friendlist.h +++ b/src/friendlist.h @@ -49,7 +49,7 @@ struct LastOnline { }; struct GroupInvite { - uint8_t data[TOX_GROUP_INVITE_DATA_SIZE]; + uint8_t *data; uint16_t length; };