diff --git a/efiXplorer/efi_defs.h b/efiXplorer/efi_defs.h index 617e5269..9308c2d1 100644 --- a/efiXplorer/efi_defs.h +++ b/efiXplorer/efi_defs.h @@ -198,12 +198,12 @@ struct efi_guid_t { } std::string to_string() const { - char res[37] = {0}; - snprintf(res, sizeof(res), + char guid_str[37] = {0}; + snprintf(guid_str, sizeof(guid_str), "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", data1, data2, data3, data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7]); - return res; + return guid_str; } }; diff --git a/efiXplorer/efi_utils.cc b/efiXplorer/efi_utils.cc index 45e063bd..ae9f8772 100644 --- a/efiXplorer/efi_utils.cc +++ b/efiXplorer/efi_utils.cc @@ -649,7 +649,7 @@ bool efi_utils::check_install_protocol(ea_t ea) { //-------------------------------------------------------------------------- // convert 64-bit value to hex string std::string efi_utils::as_hex(uint64_t value) { - char hexstr[21] = {}; + char hexstr[21] = {0}; snprintf(hexstr, sizeof(hexstr), "%" PRIX64, value); return hexstr; }