From c4b6f33f5a70eff3cc721cc66ebc1cd2cabe842a Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 13 Jun 2008 08:50:14 +0000 Subject: corrected String index to start from 1 and not from 0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1146 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UCommon.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UCommon.pas b/Game/Code/Classes/UCommon.pas index 768abe89..4465a397 100644 --- a/Game/Code/Classes/UCommon.pas +++ b/Game/Code/Classes/UCommon.pas @@ -215,7 +215,7 @@ begin exOverflow, exUnderflow, exPrecision]); end; -function StringReplaceW(text : WideString; search, rep: WideChar):WideString; +function StringReplaceW(text : WideString; search, rep: WideChar) : WideString; var iPos : integer; // sTemp : WideString; @@ -235,10 +235,10 @@ begin if search = rep then exit; - for iPos := 0 to length( result ) - 1 do + for iPos := 1 to length(result) do begin - if result[ iPos ] = search then - result[ iPos ] := rep; + if result[iPos] = search then + result[iPos] := rep; end; end; -- cgit v1.2.3