diff options
author | pranomostro <pranomestro@gmail.com> | 2016-11-03 10:35:25 +0100 |
---|---|---|
committer | z3bra <contactatz3bradotorg> | 2016-11-08 16:47:51 +0100 |
commit | 47493ccced15dc72c79080264816c9058b6d922a (patch) | |
tree | 00718731beb8e9581eb9febac6fe08f7a55676c3 /ratox.c | |
parent | aadfcd3a29cee44c054f11797bc9614726a21a6e (diff) |
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.
Diffstat (limited to 'ratox.c')
-rw-r--r-- | ratox.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |