1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 01:53:02 +01:00

Check for correct error value in toxic.

This commit is contained in:
Sebastian Stal 2013-08-07 09:57:23 -07:00
parent 2fbe37f7cf
commit 660bfc1340
2 changed files with 4 additions and 4 deletions

2
chat.c
View File

@ -127,7 +127,7 @@ static void chat_onKey(ToxWindow* self, int key) {
wattroff(ctx->history, COLOR_PAIR(1)); wattroff(ctx->history, COLOR_PAIR(1));
wprintw(ctx->history, "%s\n", ctx->line); wprintw(ctx->history, "%s\n", ctx->line);
} }
if(m_sendmessage(ctx->friendnum, (uint8_t*) ctx->line, strlen(ctx->line)+1) < 0) { if(m_sendmessage(ctx->friendnum, (uint8_t*) ctx->line, strlen(ctx->line)+1) == 0) {
wattron(ctx->history, COLOR_PAIR(3)); wattron(ctx->history, COLOR_PAIR(3));
wprintw(ctx->history, " * Failed to send message.\n"); wprintw(ctx->history, " * Failed to send message.\n");
wattroff(ctx->history, COLOR_PAIR(3)); wattroff(ctx->history, COLOR_PAIR(3));

View File

@ -260,7 +260,7 @@ static void execute(ToxWindow* self, char* u_cmd) {
msg[0] = 0; msg[0] = 0;
msg++; msg++;
if(m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) < 0) { if(m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) == 0) {
wprintw(self->window, "Error occurred while sending message.\n"); wprintw(self->window, "Error occurred while sending message.\n");
} }
else { else {