diff --git a/toml/literal.hpp b/toml/literal.hpp index 1d338b7..04fbbc1 100644 --- a/toml/literal.hpp +++ b/toml/literal.hpp @@ -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(str, str + len)); + // literal length does not include the null character at the end. return literal_internal_impl(std::move(loc)); } diff --git a/toml/parser.hpp b/toml/parser.hpp index a060114..e669816 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -2209,13 +2209,6 @@ parse(std::istream& is, const std::string& fname = "unknown file") std::vector letters(static_cast(fsize)); is.read(letters.data(), fsize); - // remove null character if exists - while(!letters.empty() && letters.back() == '\0') - { - letters.pop_back(); - } - assert(letters.empty() || letters.back() != '\0'); - // append LF. // Although TOML does not require LF at the EOF, to make parsing logic // simpler, we "normalize" the content by adding LF if it does not exist.