From b471236c50c435b04c877be2026a216e88178872 Mon Sep 17 00:00:00 2001 From: Sean Qureshi Date: Sun, 4 Aug 2013 03:52:24 -0700 Subject: Manally merged #314 and #317 --- testing/toxic/chat.c | 4 +++- testing/toxic/prompt.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'testing') diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c index 846bcf21..936eb868 100644 --- a/testing/toxic/chat.c +++ b/testing/toxic/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/testing/toxic/prompt.c b/testing/toxic/prompt.c index 3fa9d77c..463b9352 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/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]; -- cgit v1.2.3