mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Stops line-spamming and clears before printing help
This addresses one issue in #340 perfectly and slightly improves the other.
This commit is contained in:
parent
9613646af2
commit
1f001b2f91
|
@ -162,6 +162,7 @@ static void execute(ToxWindow* self, char* cmd) {
|
|||
wclear(self->window);
|
||||
}
|
||||
else if(!strcmp(cmd, "help")) {
|
||||
wclear(self->window);
|
||||
print_usage(self);
|
||||
}
|
||||
else if(!strncmp(cmd, "status ", strlen("status "))) {
|
||||
|
@ -265,7 +266,7 @@ static void execute(ToxWindow* self, char* cmd) {
|
|||
static void prompt_onKey(ToxWindow* self, int key) {
|
||||
// PRINTABLE characters: Add to line.
|
||||
if(isprint(key)) {
|
||||
if(prompt_buf_pos == (sizeof(prompt_buf) - 1)) {
|
||||
if(prompt_buf_pos == (COLS - 3)) {
|
||||
return;
|
||||
}
|
||||
prompt_buf[prompt_buf_pos++] = key;
|
||||
|
|
Loading…
Reference in New Issue
Block a user