1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-26 14:13:27 +01:00

this was right

This commit is contained in:
Jfreegman 2013-10-25 00:55:27 -04:00
parent ae7087e760
commit 3907edcdda
2 changed files with 2 additions and 2 deletions

View File

@ -378,7 +378,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
#else
if (isprint(key)) {
#endif
if (ctx->pos <= MAX_STR_SIZE) {
if (ctx->pos < (MAX_STR_SIZE-1)) {
mvwaddstr(self->window, y, x, wc_to_char(key));
ctx->line[ctx->pos++] = key;
ctx->line[ctx->pos] = L'\0';

View File

@ -136,7 +136,7 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key)
/* Add printable characters to line */
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);
prompt_buf[prompt_buf_pos++] = key;
prompt_buf[prompt_buf_pos] = '\0';