diff --git a/chat.c b/chat.c index 846bcf2..936eb86 100644 --- a/chat.c +++ b/chat.c @@ -51,6 +51,7 @@ static void chat_onMessage(ToxWindow* self, int num, uint8_t* msg, uint16_t len) wattron(ctx->history, COLOR_PAIR(2)); wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); + wattroff(ctx->history, COLOR_PAIR(2)); wattron(ctx->history, COLOR_PAIR(4)); wprintw(ctx->history, "%s: ", nick); wattroff(ctx->history, COLOR_PAIR(4)); @@ -116,6 +117,7 @@ static void chat_onKey(ToxWindow* self, int key) { /* make sure the string has at least non-space character */ wattron(ctx->history, COLOR_PAIR(2)); wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); + wattroff(ctx->history, COLOR_PAIR(2)); wattron(ctx->history, COLOR_PAIR(1)); wprintw(ctx->history, "you: ", ctx->line); wattroff(ctx->history, COLOR_PAIR(1)); @@ -254,6 +256,6 @@ ToxWindow new_chat(int friendnum) { x->friendnum = friendnum; ret.x = (void*) x; - + free(x); return ret; } diff --git a/prompt.c b/prompt.c index 3fa9d77..463b935 100644 --- a/prompt.c +++ b/prompt.c @@ -89,7 +89,9 @@ static void execute(ToxWindow* self, char* cmd) { } dht.ip.i = resolved_address; - DHT_bootstrap(dht, hex_string_to_bin(key)); + unsigned char *binary_string = hex_string_to_bin(key); + DHT_bootstrap(dht, binary_string); + free(binary_string); } else if(!strncmp(cmd, "add ", strlen("add "))) { uint8_t id_bin[32];