Skip to content

Commit

Permalink
added some error checks
Browse files Browse the repository at this point in the history
  • Loading branch information
notsecure committed Mar 23, 2014
1 parent 5d80827 commit 7c8945c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void callback_group_message(Tox *tox, int groupnumber, int friendgroupnum

uint8_t name[TOX_MAX_NAME_LENGTH];
int namelen = tox_group_peername(tox, groupnumber, friendgroupnumber, name);
if(namelen == 0)
if(namelen == 0 || namelen == -1)
{
memcpy(name, "<unknown>", 9);
namelen = 9;
Expand Down Expand Up @@ -494,8 +494,11 @@ void core_thread(void *args)
case CMSG_NEWGROUP:
{
int g = tox_add_groupchat(tox);
if(g != -1)
{
PostMessage(hwnd, WM_GADD, g, 0);
}

PostMessage(hwnd, WM_GADD, g, 0);
break;
}

Expand Down

0 comments on commit 7c8945c

Please sign in to comment.