Fix a crash with string trimming.

This commit is contained in:
2025-10-01 03:39:43 -04:00
parent 40a342d4e3
commit 92b9b057dd

View File

@ -4150,7 +4150,7 @@ static const char *Html_get_attr2(DilloHtml *html,
} }
if (tag_parsing_flags & HTML_LeftTrim) if (tag_parsing_flags & HTML_LeftTrim)
while (isspace(Buf.front())) while (not Buf.empty() and isspace(Buf.front()))
Buf.erase( 0, 1 ); Buf.erase( 0, 1 );
if (tag_parsing_flags & HTML_RightTrim) if (tag_parsing_flags & HTML_RightTrim)
while (Buf.size() && isspace( Buf.back() )) while (Buf.size() && isspace( Buf.back() ))