From 47493ccced15dc72c79080264816c9058b6d922a Mon Sep 17 00:00:00 2001 From: pranomostro Date: Thu, 3 Nov 2016 10:35:25 +0100 Subject: Cast const uint8_t* to to void * for freeing, fix one memory access on empty friend request messages, fix dataload() bug and update user status. --- ratox.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 39fc70e..7e1c993 100644 --- a/ratox.c +++ b/ratox.c @@ -107,7 +107,7 @@ static struct file ffiles[] = { }; static char *ustate[] = { - [TOX_USER_STATUS_NONE] = "none", + [TOX_USER_STATUS_NONE] = "online", [TOX_USER_STATUS_AWAY] = "away", [TOX_USER_STATUS_BUSY] = "busy" }; @@ -632,6 +632,8 @@ cbfriendrequest(Tox *m, const uint8_t *id, const uint8_t *data, uint16_t len, vo eprintf("malloc:"); memcpy(req->msg, data, len); req->msg[len] = '\0'; + } else { + req->msg = "ratox is awesome!"; } reqfifo.name = req->idstr; @@ -1054,6 +1056,7 @@ reprompt2: } toxopt->savedata_data = data; + toxopt->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE; free(intermediate); close(fd); @@ -1243,7 +1246,7 @@ toxinit(void) toxav_register_audio_callback(toxav, cbcalldata, NULL); if(toxopt.savedata_data) - free(toxopt.savedata_data); + free((void *)toxopt.savedata_data); return 0; } -- cgit v1.2.3