1
0
mirror of synced 2025-01-18 17:14:13 +01:00

fix: Editing float and double data inspector rows yielding wrong values

Fixes #571
This commit is contained in:
WerWolv 2022-07-07 18:35:10 +02:00
parent 9837473810
commit 9f4625aa00

View File

@ -54,7 +54,7 @@ namespace hex::plugin::builtin {
template<std::floating_point T>
static std::vector<u8> stringToFloat(const std::string &value, std::endian endian) requires(sizeof(T) <= sizeof(long double)) {
auto result = std::strtold(value.c_str(), nullptr);
T result = std::strtold(value.c_str(), nullptr);
std::vector<u8> bytes(sizeof(T), 0x00);
std::memcpy(bytes.data(), &result, bytes.size());