Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
bffdeddd
Commit
bffdeddd
authored
Nov 21, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fwrite/fread params
parent
fd72f658
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
cpio.cpp
native/jni/utils/cpio.cpp
+2
-2
stream.h
native/jni/utils/include/stream.h
+0
-2
stream.cpp
native/jni/utils/stream.cpp
+2
-2
No files found.
native/jni/utils/cpio.cpp
View file @
bffdeddd
...
@@ -109,7 +109,7 @@ bool cpio::exists(const char *name) {
...
@@ -109,7 +109,7 @@ bool cpio::exists(const char *name) {
return
entries
.
count
(
name
)
!=
0
;
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))
#define out_align() do_out(zeros, align_off(pos, 4))
void
cpio
::
dump
(
FILE
*
out
)
{
void
cpio
::
dump
(
FILE
*
out
)
{
size_t
pos
=
0
;
size_t
pos
=
0
;
...
@@ -142,7 +142,7 @@ void cpio::dump(FILE *out) {
...
@@ -142,7 +142,7 @@ void cpio::dump(FILE *out) {
}
}
// Write trailer
// Write trailer
sprintf
(
header
,
"070701%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x"
,
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
++
,
0
755
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
11
,
0
);
do_out
(
header
,
110
);
do_out
(
header
,
110
);
do_out
(
"TRAILER!!!
\0
"
,
11
);
do_out
(
"TRAILER!!!
\0
"
,
11
);
out_align
();
out_align
();
...
...
native/jni/utils/include/stream.h
View file @
bffdeddd
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
#include <stdio.h>
#include <stdio.h>
#include <memory>
#include <memory>
// #include <utils.h>
class
stream
;
class
stream
;
FILE
*
open_stream
(
stream
*
strm
);
FILE
*
open_stream
(
stream
*
strm
);
...
...
native/jni/utils/stream.cpp
View file @
bffdeddd
...
@@ -51,11 +51,11 @@ int stream::close() {
...
@@ -51,11 +51,11 @@ int stream::close() {
}
}
int
filter_stream
::
read
(
void
*
buf
,
size_t
len
)
{
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
)
{
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
()
{
int
filter_stream
::
close
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment