Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
external_e2fsprogs
Commits
b6da61cd
Commit
b6da61cd
authored
8 years ago
by
Treehugger Robot
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Download
Plain Diff
Merge "libext2fs: fix sparse param parsing on mac build"
parents
da08ba0d
901472ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
lib/ext2fs/sparse_io.c
lib/ext2fs/sparse_io.c
+7
-2
No files found.
lib/ext2fs/sparse_io.c
View file @
b6da61cd
...
...
@@ -196,16 +196,21 @@ static errcode_t read_sparse_argv(const char *name, bool is_fd,
{
int
ret
;
sparse_params
->
fd
=
-
1
;
sparse_params
->
file
=
NULL
;
sparse_params
->
block_size
=
0
;
sparse_params
->
blocks_count
=
0
;
sparse_params
->
file
=
malloc
(
strlen
(
name
)
+
1
);
if
(
!
sparse_params
->
file
)
{
fprintf
(
stderr
,
"failed to alloc %zu
\n
"
,
strlen
(
name
)
+
1
);
return
EXT2_ET_NO_MEMORY
;
}
if
(
is_fd
)
{
ret
=
sscanf
(
name
,
"%d:%llu:%u"
,
&
sparse_params
->
fd
,
(
unsigned
long
long
*
)
&
sparse_params
->
blocks_count
,
&
sparse_params
->
block_size
);
}
else
{
ret
=
sscanf
(
name
,
"%
m
[^:]
:
%llu%*[:]%u"
,
&
sparse_params
->
file
,
ret
=
sscanf
(
name
,
"%[^:]
%*[:]
%llu%*[:]%u"
,
sparse_params
->
file
,
(
unsigned
long
long
*
)
&
sparse_params
->
blocks_count
,
&
sparse_params
->
block_size
);
}
...
...
This diff is collapsed.
Click to expand it.
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