From 0814d36b8b2849c73e7585b79588a34df9aacdc5 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 17 Aug 2025 15:12:23 +0200 Subject: fix: tools/fsck.hefs: better options name (in= instead of i=) Signed-off-by: Amlal --- tools/fsck.hefs.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/fsck.hefs.cc b/tools/fsck.hefs.cc index eb6a66d8..22663032 100644 --- a/tools/fsck.hefs.cc +++ b/tools/fsck.hefs.cc @@ -9,29 +9,30 @@ #include #include +/// @note decimal base. static uint16_t kNumericalBase = 10; int main(int argc, char** argv) { if (argc < 2) { - mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -i= -o=" << "\n"; + mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -in= -org=" << "\n"; return EXIT_FAILURE; } auto args = mkfs::detail::build_args(argc, argv); - auto opt_disk = mkfs::get_option(args, "-i"); + auto opt_disk = mkfs::get_option(args, "-in"); - auto origin = mkfs::get_option(args, "-o"); + auto origin = mkfs::get_option(args, "-org"); if (opt_disk.empty()) { - mkfs::console_out() << "fsck: hefs: error: HeFS is empty! Exiting..." << "\n"; + mkfs::console_out() << "fsck: hefs: error: HeFS partition is empty! Exiting..." << "\n"; return EXIT_FAILURE; } auto out_origin = 0L; if (!mkfs::detail::parse_signed(origin, out_origin, kNumericalBase)) { - mkfs::console_out() << "hefs: error: Invalid -o argument.\n"; + mkfs::console_out() << "hefs: error: Invalid -org= argument.\n"; return EXIT_FAILURE; } @@ -49,9 +50,8 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - mkfs::hefs::BootNode boot_node; - - std::memset(&boot_node, 0, sizeof(boot_node)); + // @note use modern intializer list here to empty out the fields according to the struct layout. + mkfs::hefs::BootNode boot_node{}; output_device.read(reinterpret_cast(&boot_node), sizeof(boot_node)); @@ -66,9 +66,9 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - mkfs::console_out() << "hefs: HeFS partition is is healthy, exiting...\n"; + mkfs::console_out() << "hefs: HeFS partition is healthy, exiting...\n"; output_device.close(); return EXIT_SUCCESS; -} \ No newline at end of file +} -- cgit v1.2.3