fix: disallow null char at the end of input

since std::string and ""_toml literal actually does not include null
char, we don't need to check if the last char is null or not
This commit is contained in:
ToruNiina
2021-12-14 22:33:58 +09:00
parent 1b5107e5e3
commit db2aa55d20
2 changed files with 1 additions and 7 deletions

View File

@@ -87,6 +87,7 @@ operator"" _toml(const char* str, std::size_t len)
::toml::detail::location loc(
std::string("TOML literal encoded in a C++ code"),
std::vector<char>(str, str + len));
// literal length does not include the null character at the end.
return literal_internal_impl(std::move(loc));
}