Skip to content

Commit

Permalink
prevent debug assertion when code notes contain emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Apr 7, 2024
1 parent ddcc586 commit 983e317
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/win32/bindings/MultiLineGridBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ void MultiLineGridBinding::UpdateCellContents(const ItemMetrics& pItemMetrics,
for (auto nIndex : pIter->second)
{
auto nIndex2 = gsl::narrow_cast<size_t>(nIndex) - 1;
while (nIndex2 > nStop && isspace(sText.at(nIndex2 - 1)))
wchar_t c = 0; // isspace throws a debug assertion if c > 255
while (nIndex2 > nStop && (c = sText.at(nIndex2 - 1)) < 255 && isspace(c))
--nIndex2;
sText.at(nIndex2) = '\0';

Expand Down

0 comments on commit 983e317

Please sign in to comment.