1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 18:36:44 +02: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

View File

@ -45,7 +45,7 @@ static void execute(ToxWindow* self, char* u_cmd) {
int i;
int newlines = 0;
char cmd[256] = {0};
for(i = 0; i < strlen(prompt_buf); i++)
for(i = 0; i < strlen(prompt_buf); i++)
{
if (u_cmd[i] == '\n')
++newlines;
@ -260,7 +260,7 @@ static void execute(ToxWindow* self, char* u_cmd) {
msg[0] = 0;
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");
}
else {
@ -338,7 +338,7 @@ static void print_usage(ToxWindow* self) {
wprintw(self->window, " myid : Print your ID\n");
wprintw(self->window, " quit/exit : Exit program\n");
wprintw(self->window, " help : Print this message again\n");
wprintw(self->window, " clear : Clear this window\n");
wprintw(self->window, " clear : Clear this window\n");
wattron(self->window, A_BOLD);
wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n");