1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-20 13:16:36 +02:00

more succinct way to get file sizes

This commit is contained in:
Jfreegman
2014-09-24 00:06:02 -04:00
parent b071a9e992
commit 893e88294b
6 changed files with 18 additions and 43 deletions

View File

@ -156,14 +156,7 @@ void load_chat_history(ToxWindow *self, struct chatlog *log)
if (log->file == NULL)
return;
struct stat st;
if (stat(log->path, &st) == -1) {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to stat log file");
return;
}
int sz = st.st_size;
uint64_t sz = file_size(log->path);
if (sz <= 0)
return;