Skip to content

Commit

Permalink
feat [skip ci]: update single_include
Browse files Browse the repository at this point in the history
  • Loading branch information
ToruNiina committed Sep 23, 2024
1 parent 9cda72d commit d050c6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion single_include/toml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5323,7 +5323,9 @@ TOML11_INLINE std::ostringstream& format_underline(std::ostringstream& oss,
oss << make_string(lnw + 1, ' ')
<< color::bold << color::blue << " | " << color::reset;

oss << make_string(col-1 /*1-origin*/, ' ')
// in case col is 0, so we don't create a string with size_t max length
const std::size_t sanitized_col = col == 0 ? 0 : col - 1 /*1-origin*/;
oss << make_string(sanitized_col, ' ')
<< color::bold << color::red
<< make_string(len, '^') << "-- "
<< color::reset << msg << '\n';
Expand Down

0 comments on commit d050c6b

Please sign in to comment.