diff options
author | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-04 03:52:24 -0700 |
---|---|---|
committer | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-04 03:52:24 -0700 |
commit | b471236c50c435b04c877be2026a216e88178872 (patch) | |
tree | 5b0435c42fcfa9b1beefafd127aee2fc7b382059 /testing | |
parent | 91d883c4a4f0657cd298d09131369a75c8d40918 (diff) |
Manally merged #314 and #317
Diffstat (limited to 'testing')
-rw-r--r-- | testing/toxic/chat.c | 4 | ||||
-rw-r--r-- | testing/toxic/prompt.c | 4 |
2 files changed, 6 insertions, 2 deletions
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) | |||
51 | 51 | ||
52 | wattron(ctx->history, COLOR_PAIR(2)); | 52 | wattron(ctx->history, COLOR_PAIR(2)); |
53 | wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); | 53 | wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); |
54 | wattroff(ctx->history, COLOR_PAIR(2)); | ||
54 | wattron(ctx->history, COLOR_PAIR(4)); | 55 | wattron(ctx->history, COLOR_PAIR(4)); |
55 | wprintw(ctx->history, "%s: ", nick); | 56 | wprintw(ctx->history, "%s: ", nick); |
56 | wattroff(ctx->history, COLOR_PAIR(4)); | 57 | wattroff(ctx->history, COLOR_PAIR(4)); |
@@ -116,6 +117,7 @@ static void chat_onKey(ToxWindow* self, int key) { | |||
116 | /* make sure the string has at least non-space character */ | 117 | /* make sure the string has at least non-space character */ |
117 | wattron(ctx->history, COLOR_PAIR(2)); | 118 | wattron(ctx->history, COLOR_PAIR(2)); |
118 | wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); | 119 | wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); |
120 | wattroff(ctx->history, COLOR_PAIR(2)); | ||
119 | wattron(ctx->history, COLOR_PAIR(1)); | 121 | wattron(ctx->history, COLOR_PAIR(1)); |
120 | wprintw(ctx->history, "you: ", ctx->line); | 122 | wprintw(ctx->history, "you: ", ctx->line); |
121 | wattroff(ctx->history, COLOR_PAIR(1)); | 123 | wattroff(ctx->history, COLOR_PAIR(1)); |
@@ -254,6 +256,6 @@ ToxWindow new_chat(int friendnum) { | |||
254 | x->friendnum = friendnum; | 256 | x->friendnum = friendnum; |
255 | 257 | ||
256 | ret.x = (void*) x; | 258 | ret.x = (void*) x; |
257 | 259 | free(x); | |
258 | return ret; | 260 | return ret; |
259 | } | 261 | } |
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) { | |||
89 | } | 89 | } |
90 | 90 | ||
91 | dht.ip.i = resolved_address; | 91 | dht.ip.i = resolved_address; |
92 | DHT_bootstrap(dht, hex_string_to_bin(key)); | 92 | unsigned char *binary_string = hex_string_to_bin(key); |
93 | DHT_bootstrap(dht, binary_string); | ||
94 | free(binary_string); | ||
93 | } | 95 | } |
94 | else if(!strncmp(cmd, "add ", strlen("add "))) { | 96 | else if(!strncmp(cmd, "add ", strlen("add "))) { |
95 | uint8_t id_bin[32]; | 97 | uint8_t id_bin[32]; |