diff options
-rw-r--r-- | testing/toxic/chat.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c index 10837aa7..50aa81b0 100644 --- a/testing/toxic/chat.c +++ b/testing/toxic/chat.c | |||
@@ -52,7 +52,12 @@ static void chat_onMessage(ToxWindow* self, int num, uint8_t* msg, uint16_t len) | |||
52 | char min[2]; | 52 | char min[2]; |
53 | char hour[2]; | 53 | char hour[2]; |
54 | sprintf(hour,"%d",inthour); | 54 | sprintf(hour,"%d",inthour); |
55 | sprintf(min,"%d",intmin); | 55 | if (intmin < 10) { |
56 | sprintf(min,"0%d",intmin); | ||
57 | } else { | ||
58 | sprintf(min,"%d",intmin); | ||
59 | } | ||
60 | |||
56 | 61 | ||
57 | wattron(ctx->history, COLOR_PAIR(2)); | 62 | wattron(ctx->history, COLOR_PAIR(2)); |
58 | wprintw(ctx->history,"%s",hour); | 63 | wprintw(ctx->history,"%s",hour); |
@@ -109,7 +114,11 @@ static void chat_onKey(ToxWindow* self, int key) { | |||
109 | char min[2]; | 114 | char min[2]; |
110 | char hour[2]; | 115 | char hour[2]; |
111 | sprintf(hour,"%d",inthour); | 116 | sprintf(hour,"%d",inthour); |
112 | sprintf(min,"%d",intmin); | 117 | if (intmin < 10) { |
118 | sprintf(min,"0%d",intmin); | ||
119 | } else { | ||
120 | sprintf(min,"%d",intmin); | ||
121 | } | ||
113 | 122 | ||
114 | wattron(ctx->history, COLOR_PAIR(2)); | 123 | wattron(ctx->history, COLOR_PAIR(2)); |
115 | wprintw(ctx->history,"%s",hour); | 124 | wprintw(ctx->history,"%s",hour); |