0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00

modules/console: Fix mem get string value interp.

This commit is contained in:
Jason Volk 2020-06-13 18:56:44 -07:00
parent 58bcab259f
commit 4c4a94e457

View file

@ -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<const ssize_t *>(data(val))) << std::endl;
break;
default:
case "unsigned"_:
out << lex_cast(*reinterpret_cast<const unsigned *>(data(val))) << std::endl;
break;
@ -1279,9 +1280,8 @@ console_cmd__mem__get(opt &out, const string_view &line)
out << lex_cast(*reinterpret_cast<const uintptr_t *>(data(val))) << std::endl;
break;
default:
case "string"_:
out << val << std::endl;
out << *reinterpret_cast<const char *const *const>(data(val)) << std::endl;
break;
}