diff --git a/src/gfx/pal_spec.cpp b/src/gfx/pal_spec.cpp index 484b57b8..ffd5deaa 100644 --- a/src/gfx/pal_spec.cpp +++ b/src/gfx/pal_spec.cpp @@ -240,11 +240,11 @@ static bool readLine(std::filebuf &file, std::string &buffer) { template // Should be uint*_t static std::optional parseDec(std::string const &str, std::string::size_type &n) { uintmax_t value = 0; - auto result = std::from_chars(str.data(), str.data() + str.size(), value); - if ((bool)result.ec) { + auto result = std::from_chars(str.data() + n, str.data() + str.size(), value); + if (static_cast(result.ec)) { return std::nullopt; } - n += result.ptr - str.data(); + n = result.ptr - str.data(); return std::optional{value}; } diff --git a/test/gfx/truncated_gpl.err b/test/gfx/truncated_gpl.err deleted file mode 100644 index 1ee64920..00000000 --- a/test/gfx/truncated_gpl.err +++ /dev/null @@ -1,2 +0,0 @@ -error: GPL palette file appears to be truncated -Conversion aborted after 1 error diff --git a/test/gfx/truncated_gpl.flags b/test/gfx/truncated_gpl.flags deleted file mode 100644 index 102b83ef..00000000 --- a/test/gfx/truncated_gpl.flags +++ /dev/null @@ -1 +0,0 @@ --c gpl:truncated_gpl.gpl diff --git a/test/gfx/truncated_gpl.gpl b/test/gfx/truncated_gpl.gpl deleted file mode 100644 index ab477b6a..00000000 --- a/test/gfx/truncated_gpl.gpl +++ /dev/null @@ -1 +0,0 @@ -GIMP Palette diff --git a/test/gfx/truncated_gpl.png b/test/gfx/truncated_gpl.png deleted file mode 100644 index 57fdd36f..00000000 Binary files a/test/gfx/truncated_gpl.png and /dev/null differ