From bf4b71e61794a5ea2c492afcc0175db11d23c76d Mon Sep 17 00:00:00 2001 From: g Date: Sat, 3 Aug 2013 15:59:46 +0800 Subject: [PATCH 1/2] Added break Statement --- prompt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/prompt.c b/prompt.c index b0f8381..b248b63 100644 --- a/prompt.c +++ b/prompt.c @@ -140,6 +140,7 @@ static void execute(ToxWindow* self, char* cmd) { break; case -2: wprintw(self->window, "Please add a message to your request.\n"); + break; case -3: wprintw(self->window, "That appears to be your own ID.\n"); break; From 77b7694c418c5770dfad4ed518ac19066ba980f5 Mon Sep 17 00:00:00 2001 From: Sean Qureshi Date: Sat, 3 Aug 2013 03:59:27 -0700 Subject: [PATCH 2/2] Fixed a segfault when recieving text --- chat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chat.c b/chat.c index 0e14a29..b835cf2 100644 --- a/chat.c +++ b/chat.c @@ -63,8 +63,6 @@ static void chat_onMessage(ToxWindow* self, int num, uint8_t* msg, uint16_t len) wprintw(ctx->history,"%s",hour); wprintw(ctx->history,":%s ",min); wattron(ctx->history, COLOR_PAIR(4)); - wprintw(ctx->history, "%s: ", now); - wattron(ctx->history, COLOR_PAIR(4)); wprintw(ctx->history, "%s: ", nick); wattroff(ctx->history, COLOR_PAIR(4)); wprintw(ctx->history, "%s\n", msg); @@ -109,17 +107,19 @@ static void chat_onKey(ToxWindow* self, int key) { } else if(key == '\n') { + printf("Get times to int"); int inthour = timeinfo->tm_hour; //Pretty bad, but it gets the job done int intmin = timeinfo->tm_min; char min[2]; char hour[2]; + printf("Turn to varible"); sprintf(hour,"%d",inthour); if (intmin < 10) { sprintf(min,"0%d",intmin); } else { sprintf(min,"%d",intmin); } - + printf("Display"); wattron(ctx->history, COLOR_PAIR(2)); wprintw(ctx->history,"%s",hour); wprintw(ctx->history,":%s ",min);