mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 05:23:02 +01:00
this was right
This commit is contained in:
parent
ae7087e760
commit
3907edcdda
@ -378,7 +378,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
|||||||
#else
|
#else
|
||||||
if (isprint(key)) {
|
if (isprint(key)) {
|
||||||
#endif
|
#endif
|
||||||
if (ctx->pos <= MAX_STR_SIZE) {
|
if (ctx->pos < (MAX_STR_SIZE-1)) {
|
||||||
mvwaddstr(self->window, y, x, wc_to_char(key));
|
mvwaddstr(self->window, y, x, wc_to_char(key));
|
||||||
ctx->line[ctx->pos++] = key;
|
ctx->line[ctx->pos++] = key;
|
||||||
ctx->line[ctx->pos] = L'\0';
|
ctx->line[ctx->pos] = L'\0';
|
||||||
|
@ -136,7 +136,7 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key)
|
|||||||
|
|
||||||
/* Add printable characters to line */
|
/* Add printable characters to line */
|
||||||
else if (isprint(key)) {
|
else if (isprint(key)) {
|
||||||
if (prompt_buf_pos <= MAX_STR_SIZE) {
|
if (prompt_buf_pos < (MAX_STR_SIZE-1)) {
|
||||||
mvwaddch(self->window, y, x, key);
|
mvwaddch(self->window, y, x, key);
|
||||||
prompt_buf[prompt_buf_pos++] = key;
|
prompt_buf[prompt_buf_pos++] = key;
|
||||||
prompt_buf[prompt_buf_pos] = '\0';
|
prompt_buf[prompt_buf_pos] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user