magiskboot: Avoid implicit type conversion

Fix #9607
This commit is contained in:
Pzqqt
2025-12-27 00:32:42 +08:00
committed by John Wu
parent 18c1347bd3
commit 0919db6b11

View File

@@ -611,7 +611,9 @@ bool boot_img::parse_image(const uint8_t *addr, FileFormat type) {
int split_image_dtb(Utf8CStr filename, bool skip_decomp) {
mmap_data img(filename.c_str());
if (size_t off = find_dtb_offset(img.data(), img.size()); off > 0) {
if (int offset = find_dtb_offset(img.data(), img.size()); offset > 0) {
size_t off = (size_t) offset;
FileFormat fmt = check_fmt_lg(img.data(), img.size());
if (!skip_decomp && fmt_compressed(fmt)) {
int fd = creat(KERNEL_FILE, 0644);