1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-24 17:13:26 +01:00

Merge pull request #56 from aitjcize/bugfix

Make sure friend message is null-terminated else generate garbate on screen
This commit is contained in:
irungentoo 2013-11-28 05:38:12 -08:00
commit 57fe226d71

View File

@ -217,6 +217,9 @@ static void prompt_onConnectionChange(ToxWindow *self, Tox *m, int friendnum , u
static void prompt_onFriendRequest(ToxWindow *self, uint8_t *key, uint8_t *data, uint16_t length) static void prompt_onFriendRequest(ToxWindow *self, uint8_t *key, uint8_t *data, uint16_t length)
{ {
// make sure message data is null-terminated
data[length - 1] = 0;
wprintw(self->window, "\nFriend request with the message: %s\n", data); wprintw(self->window, "\nFriend request with the message: %s\n", data);
int n = add_friend_request(key); int n = add_friend_request(key);