mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-03 12:06:45 +02:00
Lots of bug fixes and general code cleanup
This commit is contained in:
@ -179,7 +179,7 @@ void load_chat_history(ToxWindow *self, struct chatlog *log)
|
||||
if (sz <= 0)
|
||||
return;
|
||||
|
||||
char *hstbuf = malloc(sz);
|
||||
char *hstbuf = malloc(sz + 1);
|
||||
|
||||
if (hstbuf == NULL)
|
||||
exit_toxic_err("failed in load_chat_history", FATALERR_MEMORY);
|
||||
@ -196,6 +196,8 @@ void load_chat_history(ToxWindow *self, struct chatlog *log)
|
||||
return;
|
||||
}
|
||||
|
||||
hstbuf[sz] = '\0';
|
||||
|
||||
/* Number of history lines to load: must not be larger than MAX_LINE_INFO_QUEUE - 2 */
|
||||
int L = MIN(MAX_LINE_INFO_QUEUE - 2, user_settings->history_size);
|
||||
int start, count = 0;
|
||||
|
Reference in New Issue
Block a user