1
0
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:
Jfreegman
2014-09-24 15:15:07 -04:00
parent a432d733d7
commit 00cccad22c
4 changed files with 11 additions and 11 deletions

View File

@ -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");
}