summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/fdtdump.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Utilities/fdtdump.cpp b/Userland/Utilities/fdtdump.cpp
index b6e6841c18..46ab0e3094 100644
--- a/Userland/Utilities/fdtdump.cpp
+++ b/Userland/Utilities/fdtdump.cpp
@@ -29,9 +29,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
- auto* fdt_header = reinterpret_cast<DeviceTree::FlattenedDeviceTreeHeader const*>(file->data());
+ auto const* fdt_header = reinterpret_cast<DeviceTree::FlattenedDeviceTreeHeader const*>(file->data());
+ auto bytes = ReadonlyBytes { file->data(), file->size() };
- bool valid = DeviceTree::dump(*fdt_header, static_cast<u8 const*>(file->data()), file->size());
+ TRY(DeviceTree::dump(*fdt_header, bytes));
- return valid ? 0 : 1;
+ return 0;
}