mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-20 13:06:36 +02:00
a few general fixes
This commit is contained in:
@ -158,7 +158,7 @@ void load_chat_history(ToxWindow *self, struct chatlog *log)
|
||||
|
||||
off_t sz = file_size(log->path);
|
||||
|
||||
if (sz == 0)
|
||||
if (sz <= 0)
|
||||
return;
|
||||
|
||||
char *hstbuf = malloc(sz);
|
||||
@ -195,7 +195,7 @@ void load_chat_history(ToxWindow *self, struct chatlog *log)
|
||||
return;
|
||||
}
|
||||
|
||||
while (line != NULL) {
|
||||
while (line != NULL && count--) {
|
||||
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s", line);
|
||||
line = strtok(NULL, "\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user