Commit 3fe1ca62 authored by Julian Rother's avatar Julian Rother

Fixed json_fileinfo to support filesizes > 4GB

parent ae02323f
...@@ -14,7 +14,7 @@ char *mprintf(const char *fmt, ...); ...@@ -14,7 +14,7 @@ char *mprintf(const char *fmt, ...);
void *xmalloc(size_t size); void *xmalloc(size_t size);
char *hashfile(char *path); char *hashfile(char *path);
double fileduration(char *path); double fileduration(char *path);
size_t filesize(char *path); off_t filesize(char *path);
char *json_fileinfo(char *path); char *json_fileinfo(char *path);
void overwrite_check(char *path, char *srcpath, char *srchash); void overwrite_check(char *path, char *srcpath, char *srchash);
int checktime(time_t min); int checktime(time_t min);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "../util.h" #include "../util.h"
size_t filesize(char *path) off_t filesize(char *path)
{ {
struct stat s; struct stat s;
if (stat(path, &s)) if (stat(path, &s))
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
char *json_fileinfo(char *path) char *json_fileinfo(char *path)
{ {
return mprintf("\"hash\": \"%s\", \"duration\": %f, \"filesize\": %i", return mprintf("\"hash\": \"%s\", \"duration\": %f, \"filesize\": %li",
hashfile(path), fileduration(path), filesize(path)); hashfile(path), fileduration(path), filesize(path));
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment