diff --git a/src/global_commands.c b/src/global_commands.c index 4b7a37a..f3aa18c 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -334,7 +334,7 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA return; } - if (len > TOXIC_MAX_NAME_LENGTH) { + if (len >= TOXIC_MAX_NAME_LENGTH) { len = TOXIC_MAX_NAME_LENGTH; nick[len-1] = L'\0'; } diff --git a/src/line_info.c b/src/line_info.c index 4909a73..34a3580 100644 --- a/src/line_info.c +++ b/src/line_info.c @@ -149,6 +149,7 @@ void line_info_add(ToxWindow *self, uint8_t *tmstmp, uint8_t *name1, uint8_t *na if (hst->line_start->prev == NULL) { /* if line_start is root move it forward as well */ hst->line_start = hst->line_start->next; hst->line_start->prev = NULL; + ++hst->start_id; } free(hst->line_root);