Fix sstr() to return the exact wanted length instead of length + 1

This commit is contained in:
Ansgar Becker
2008-12-03 12:25:00 +00:00
parent 6b2c95df14
commit 6fa7b9363e

View File

@ -686,7 +686,7 @@ function sstr(str: WideString; len: Integer) : WideString;
begin begin
if length(str) > len then if length(str) > len then
begin begin
str := copy(str, 0, len); str := copy(str, 0, len-1);
str := str + '<27>'; str := str + '<27>';
end; end;
result := str; result := str;