aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqfs/read_super.c10
-rw-r--r--unpack/rdsquashfs.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/sqfs/read_super.c b/lib/sqfs/read_super.c
index 22dd822..3b41fbd 100644
--- a/lib/sqfs/read_super.c
+++ b/lib/sqfs/read_super.c
@@ -54,6 +54,16 @@ int sqfs_super_read(sqfs_super_t *super, int fd)
return -1;
}
+ if ((temp.version_major != SQFS_VERSION_MAJOR) ||
+ (temp.version_minor != SQFS_VERSION_MINOR)) {
+ fprintf(stderr,
+ "The squashfs image uses squashfs version %d.%d\n"
+ "This tool currently only supports version %d.%d.\n",
+ temp.version_major, temp.version_minor,
+ SQFS_VERSION_MAJOR, SQFS_VERSION_MINOR);
+ return -1;
+ }
+
if ((temp.block_size - 1) & temp.block_size) {
fputs("Block size in image is not a power of 2!\n", stderr);
return -1;
diff --git a/unpack/rdsquashfs.c b/unpack/rdsquashfs.c
index 125a841..fcfc9c9 100644
--- a/unpack/rdsquashfs.c
+++ b/unpack/rdsquashfs.c
@@ -56,16 +56,6 @@ int main(int argc, char **argv)
if (sqfs_super_read(&super, sqfsfd))
goto out_fd;
- if ((super.version_major != SQFS_VERSION_MAJOR) ||
- (super.version_minor != SQFS_VERSION_MINOR)) {
- fprintf(stderr,
- "The image uses squashfs version %d.%d\n"
- "We currently only supports version %d.%d (sorry).\n",
- super.version_major, super.version_minor,
- SQFS_VERSION_MAJOR, SQFS_VERSION_MINOR);
- goto out_fd;
- }
-
if (!compressor_exists(super.compression_id)) {
fputs("Image uses a compressor that has not been built in\n",
stderr);