mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user