From 277c83e6d8bb8e790069a57eb19ccf1b7f783f73 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 19 Feb 2023 09:18:17 +0100 Subject: [PATCH] fix: Uninitialized value build issue --- plugins/builtin/include/content/views/view_data_inspector.hpp | 4 ++-- plugins/builtin/source/content/data_inspector.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/builtin/include/content/views/view_data_inspector.hpp b/plugins/builtin/include/content/views/view_data_inspector.hpp index 4766a2b5d..0a20dc2ef 100644 --- a/plugins/builtin/include/content/views/view_data_inspector.hpp +++ b/plugins/builtin/include/content/views/view_data_inspector.hpp @@ -27,7 +27,7 @@ namespace hex::plugin::builtin { bool m_shouldInvalidate = true; - std::endian m_endian = std::endian::native; + std::endian m_endian = std::endian::native; ContentRegistry::DataInspector::NumberDisplayStyle m_numberDisplayStyle = ContentRegistry::DataInspector::NumberDisplayStyle::Decimal; bool m_invert = false; @@ -38,7 +38,7 @@ namespace hex::plugin::builtin { std::vector m_cachedData, m_workData; TaskHolder m_updateTask; - std::string m_editingValue; + std::string m_editingValue = ""; }; } \ No newline at end of file diff --git a/plugins/builtin/source/content/data_inspector.cpp b/plugins/builtin/source/content/data_inspector.cpp index 68f3bdbd0..c72160f91 100644 --- a/plugins/builtin/source/content/data_inspector.cpp +++ b/plugins/builtin/source/content/data_inspector.cpp @@ -142,7 +142,7 @@ namespace hex::plugin::builtin { }, [](std::string value, std::endian endian) -> std::vector { hex::unused(endian); - if (value.starts_with("0b")) + if (value.size() > 2 && value.starts_with("0b")) value = value.substr(2); if (value.size() > 8) return { };