diff --git a/Makefile b/Makefile index 9c18b8a..5b4139f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MAGIC_CFLAGS=-DHAVE_MAGIC MAGIC_LIBS=-lmagic CC=gcc -CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L $(MAGIC_CFLAGS) +CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L -D_FILE_OFFSET_BITS=64 $(MAGIC_CFLAGS) LIBS=-lmicrohttpd $(MAGIC_LIBS) TARGET=fileshare diff --git a/dirlisting.c b/dirlisting.c index dd54924..dd65bb0 100644 --- a/dirlisting.c +++ b/dirlisting.c @@ -21,11 +21,11 @@ struct Entry { char *name; - size_t size; + off_t size; uint8_t flags; }; -const char* format_size(size_t s) { +const char* format_size(off_t s) { static char buf[32]; const char *prefixes = " kMGTPEZY"; float fs = s;