Skip to content

Commit

Permalink
fix iterate may be advanced after string end
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Oct 30, 2024
1 parent 00d0754 commit ed1ba65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vstgui/lib/ctexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ inline void replaceTabs (std::string& str, uint32_t tabWidth)
//------------------------------------------------------------------------
inline void convertWinLineEndingsToUnixLineEndings (String& text)
{
auto it = text.begin (), end = text.end ();
if (it == end)
auto it = text.begin ();
if (it == text.end ())
return;
auto lastChar = it;
++it;
for (; it != end; ++it)
for (; it != text.end (); ++it)
{
if (*lastChar == '\r' && *it == '\n')
{
Expand Down

0 comments on commit ed1ba65

Please sign in to comment.