From 16a329e152d8573aed882c8a4c0d65f403ce3a48 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 29 Jan 2015 20:23:06 +0100 Subject: Add large file support --- src/Makefile.am | 10 ++++++++-- src/libirecovery.c | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 4316454..73ae945 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,13 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusb_CFLAGS) -AM_LDFLAGS = $(libusb_LIBS) $(LIBIRECOVERYLDFLAGS) +AM_CFLAGS = \ + $(GLOBAL_CFLAGS) \ + $(LFS_CFLAGS) \ + $(libusb_CFLAGS) + +AM_LDFLAGS = \ + $(libusb_LIBS) \ + $(LIBIRECOVERYLDFLAGS) lib_LTLIBRARIES = libirecovery.la libirecovery_la_CFLAGS = $(AM_CFLAGS) diff --git a/src/libirecovery.c b/src/libirecovery.c index d632b63..fa0f417 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -1129,9 +1129,9 @@ IRECV_API irecv_error_t irecv_send_file(irecv_client_t client, const char* filen return IRECV_E_FILE_NOT_FOUND; } - fseek(file, 0, SEEK_END); - long length = ftell(file); - fseek(file, 0, SEEK_SET); + fseeko(file, 0, SEEK_END); + long length = ftello(file); + fseeko(file, 0, SEEK_SET); char* buffer = (char*) malloc(length); if (buffer == NULL) { -- cgit v1.1-32-gdbae