Skip to content

Commit ed1d597

Browse files
committed
Fix bug in StrCompressWhiteSpace function
Bug per issue in StrCompressWhiteSpace function. Fixes #95
1 parent 1403353 commit ed1d597

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Src/UStrUtils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ function StrCompressWhiteSpace(const Str: UnicodeString): UnicodeString;
404404
Inc(ResCount);
405405
// Skip past any following white space
406406
Inc(Idx);
407-
while TCharacter.IsWhiteSpace(Str[Idx]) do
407+
while (Idx <= Length(Str)) and TCharacter.IsWhiteSpace(Str[Idx]) do
408408
Inc(Idx);
409409
end
410410
else

0 commit comments

Comments
 (0)