diff --git a/utils/jz4740_usbtool/jz4740_usbtool.c b/utils/jz4740_usbtool/jz4740_usbtool.c index 908cf723d0..84ffbf7098 100755 --- a/utils/jz4740_usbtool/jz4740_usbtool.c +++ b/utils/jz4740_usbtool/jz4740_usbtool.c @@ -349,7 +349,8 @@ found: int filesize(FILE* fd) { int tmp; - tmp = fseek(fd, 0, SEEK_END); + fseek(fd, 0, SEEK_END); + tmp = ftell(fd); fseek(fd, 0, SEEK_SET); return tmp; } @@ -427,6 +428,8 @@ int main(int argc, char* argv[]) } fclose(fd); + fprintf(stderr, "[INFO] File size: %d bytes\n", n); + jzconnect(address, buf, len, 1); break; case 2: