summaryrefslogtreecommitdiff
path: root/testing/toxic/prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r--testing/toxic/prompt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c
index 16750c5d..c832db39 100644
--- a/testing/toxic/prompt.c
+++ b/testing/toxic/prompt.c
@@ -159,10 +159,11 @@ static void execute(ToxWindow* self, char* cmd) {
159 } 159 }
160 } 160 }
161 else if(!strcmp(cmd, "clear")) { 161 else if(!strcmp(cmd, "clear")) {
162 wclear(self->window); 162 wclear(self->window);
163 } 163 }
164 else if(!strcmp(cmd, "help")) { 164 else if(!strcmp(cmd, "help")) {
165 print_usage(self); 165 wclear(self->window);
166 print_usage(self);
166 } 167 }
167 else if(!strncmp(cmd, "status ", strlen("status "))) { 168 else if(!strncmp(cmd, "status ", strlen("status "))) {
168 char* msg; 169 char* msg;
@@ -265,8 +266,8 @@ static void execute(ToxWindow* self, char* cmd) {
265static void prompt_onKey(ToxWindow* self, int key) { 266static void prompt_onKey(ToxWindow* self, int key) {
266 // PRINTABLE characters: Add to line. 267 // PRINTABLE characters: Add to line.
267 if(isprint(key)) { 268 if(isprint(key)) {
268 if(prompt_buf_pos == (sizeof(prompt_buf) - 1)) { 269 if(prompt_buf_pos == (COLS - 3)) {
269 return; 270 return;
270 } 271 }
271 prompt_buf[prompt_buf_pos++] = key; 272 prompt_buf[prompt_buf_pos++] = key;
272 prompt_buf[prompt_buf_pos] = 0; 273 prompt_buf[prompt_buf_pos] = 0;