Skip to content

Commit

Permalink
fix: check for derived type first
Browse files Browse the repository at this point in the history
Signed-off-by: svoboda18 <[email protected]>
  • Loading branch information
svoboda18 committed Jun 15, 2024
1 parent 328a812 commit 0a814ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions e2fstool.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void usage(int ret)
exit(ret);
}

static const char* get_image_type_str(image_type_t type)
static const char *get_image_type_str(image_type_t type)
{
switch (type)
{
Expand Down Expand Up @@ -95,13 +95,13 @@ static image_type_t get_image_type(const char *filename)
goto end;
}

if (sparse_magic == SPARSE_HEADER_MAGIC)
if (sparse_magic == SPARSE_HEADER_MAGIC && moto_magic == MOTO_HEADER_MAGIC)
{
type = SPARSE;
type = MOTO;
}
else if (moto_magic == MOTO_HEADER_MAGIC)
else if (sparse_magic == SPARSE_HEADER_MAGIC)
{
type = MOTO;
type = SPARSE;
}
else if (ext4_magic == EXT2_SUPER_MAGIC)
{
Expand Down Expand Up @@ -839,7 +839,7 @@ int main(int argc, char *argv[])
io_mgr = sparse_io_manager;
else
io_mgr = moto_io_manager;

if (asprintf(&new_in_file, "(%s):0:%u", in_file, blocksize) == -1)
{
E2FSTOOL_ERROR("while allocating file name");
Expand Down

0 comments on commit 0a814ef

Please sign in to comment.