diff options
author | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-03 03:59:27 -0700 |
---|---|---|
committer | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-03 03:59:27 -0700 |
commit | 52f1dcd9ffc6116d8f45a5451a23cc99becb0d2e (patch) | |
tree | 1899ce71ee5eabb196268f8055fed11bcef41450 /testing | |
parent | cef0c68bdcaaf213d372aa5817b2a558f79838be (diff) |
Fixed a segfault when recieving text
Diffstat (limited to 'testing')
-rw-r--r-- | testing/toxic/chat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c index 0e14a295..b835cf2d 100644 --- a/testing/toxic/chat.c +++ b/testing/toxic/chat.c | |||
@@ -63,8 +63,6 @@ static void chat_onMessage(ToxWindow* self, int num, uint8_t* msg, uint16_t len) | |||
63 | wprintw(ctx->history,"%s",hour); | 63 | wprintw(ctx->history,"%s",hour); |
64 | wprintw(ctx->history,":%s ",min); | 64 | wprintw(ctx->history,":%s ",min); |
65 | wattron(ctx->history, COLOR_PAIR(4)); | 65 | wattron(ctx->history, COLOR_PAIR(4)); |
66 | wprintw(ctx->history, "%s: ", now); | ||
67 | wattron(ctx->history, COLOR_PAIR(4)); | ||
68 | wprintw(ctx->history, "%s: ", nick); | 66 | wprintw(ctx->history, "%s: ", nick); |
69 | wattroff(ctx->history, COLOR_PAIR(4)); | 67 | wattroff(ctx->history, COLOR_PAIR(4)); |
70 | wprintw(ctx->history, "%s\n", msg); | 68 | wprintw(ctx->history, "%s\n", msg); |
@@ -109,17 +107,19 @@ static void chat_onKey(ToxWindow* self, int key) { | |||
109 | } | 107 | } |
110 | else if(key == '\n') { | 108 | else if(key == '\n') { |
111 | 109 | ||
110 | printf("Get times to int"); | ||
112 | int inthour = timeinfo->tm_hour; //Pretty bad, but it gets the job done | 111 | int inthour = timeinfo->tm_hour; //Pretty bad, but it gets the job done |
113 | int intmin = timeinfo->tm_min; | 112 | int intmin = timeinfo->tm_min; |
114 | char min[2]; | 113 | char min[2]; |
115 | char hour[2]; | 114 | char hour[2]; |
115 | printf("Turn to varible"); | ||
116 | sprintf(hour,"%d",inthour); | 116 | sprintf(hour,"%d",inthour); |
117 | if (intmin < 10) { | 117 | if (intmin < 10) { |
118 | sprintf(min,"0%d",intmin); | 118 | sprintf(min,"0%d",intmin); |
119 | } else { | 119 | } else { |
120 | sprintf(min,"%d",intmin); | 120 | sprintf(min,"%d",intmin); |
121 | } | 121 | } |
122 | 122 | printf("Display"); | |
123 | wattron(ctx->history, COLOR_PAIR(2)); | 123 | wattron(ctx->history, COLOR_PAIR(2)); |
124 | wprintw(ctx->history,"%s",hour); | 124 | wprintw(ctx->history,"%s",hour); |
125 | wprintw(ctx->history,":%s ",min); | 125 | wprintw(ctx->history,":%s ",min); |