From 4c4a94e457618177b3d7dc9db51f964860bdb051 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 13 Jun 2020 18:56:44 -0700 Subject: [PATCH] modules/console: Fix mem get string value interp. --- modules/console.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index 13a30c18d..b3bbd9b19 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -1240,10 +1240,10 @@ console_cmd__mem__get(opt &out, const string_view &line) const string_view &type { - param.at("type", "string"_sv) + param.at("type", "unsigned"_sv) }; - thread_local char buf[4_KiB]; + char buf[512]; const string_view &val { allocator::get(key, buf) @@ -1267,6 +1267,7 @@ console_cmd__mem__get(opt &out, const string_view &line) out << lex_cast(*reinterpret_cast(data(val))) << std::endl; break; + default: case "unsigned"_: out << lex_cast(*reinterpret_cast(data(val))) << std::endl; break; @@ -1279,9 +1280,8 @@ console_cmd__mem__get(opt &out, const string_view &line) out << lex_cast(*reinterpret_cast(data(val))) << std::endl; break; - default: case "string"_: - out << val << std::endl; + out << *reinterpret_cast(data(val)) << std::endl; break; }