Skip to content

Commit

Permalink
🚨 fixed PVS V567 warning
Browse files Browse the repository at this point in the history
"V567 The modification of the 'position.chars_read_current_line' variable is unsequenced relative to another operation on the same variable. This may lead to undefined behavior."
  • Loading branch information
nlohmann committed Dec 30, 2018
1 parent 6f89613 commit c682b98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/nlohmann/detail/input/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ class lexer
if (current == '\n')
{
++position.lines_read;
++position.chars_read_current_line = 0;
position.chars_read_current_line = 0;
}

return current;
Expand Down
2 changes: 1 addition & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3829,7 +3829,7 @@ class lexer
if (current == '\n')
{
++position.lines_read;
++position.chars_read_current_line = 0;
position.chars_read_current_line = 0;
}

return current;
Expand Down

0 comments on commit c682b98

Please sign in to comment.