diff --git a/native/jni/utils/cpio.cpp b/native/jni/utils/cpio.cpp index 76e4ccb5e..a62754f58 100644 --- a/native/jni/utils/cpio.cpp +++ b/native/jni/utils/cpio.cpp @@ -109,7 +109,7 @@ bool cpio::exists(const char *name) { return entries.count(name) != 0; } -#define do_out(buf, len) pos += fwrite(buf, len, 1, out); +#define do_out(buf, len) pos += fwrite(buf, 1, len, out); #define out_align() do_out(zeros, align_off(pos, 4)) void cpio::dump(FILE *out) { size_t pos = 0; @@ -142,7 +142,7 @@ void cpio::dump(FILE *out) { } // Write trailer sprintf(header, "070701%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", - inode++, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 11, 0); + inode++, 0755, 0, 0, 1, 0, 0, 0, 0, 0, 0, 11, 0); do_out(header, 110); do_out("TRAILER!!!\0", 11); out_align(); diff --git a/native/jni/utils/include/stream.h b/native/jni/utils/include/stream.h index eaed8a144..b46d91d6e 100644 --- a/native/jni/utils/include/stream.h +++ b/native/jni/utils/include/stream.h @@ -4,8 +4,6 @@ #include #include -// #include - class stream; FILE *open_stream(stream *strm); diff --git a/native/jni/utils/stream.cpp b/native/jni/utils/stream.cpp index 607b4d026..a28734589 100644 --- a/native/jni/utils/stream.cpp +++ b/native/jni/utils/stream.cpp @@ -51,11 +51,11 @@ int stream::close() { } int filter_stream::read(void *buf, size_t len) { - return fread(buf, len, 1, fp); + return fread(buf, 1, len, fp); } int filter_stream::write(const void *buf, size_t len) { - return fwrite(buf, len, 1, fp); + return fwrite(buf, 1, len, fp); } int filter_stream::close() {