* Fixed reading beyond input string in fpc_Val_Real_ShortStr if empty string was passed.

git-svn-id: trunk@5849 -
This commit is contained in:
yury 2007-01-08 15:12:48 +00:00
parent a2f4c7fd2a
commit 697875f5af

View File

@ -908,6 +908,7 @@ begin
sign:=1; sign:=1;
while (code<=length(s)) and (s[code] in [' ',#9]) do while (code<=length(s)) and (s[code] in [' ',#9]) do
inc(code); inc(code);
if code<=length(s) then
case s[code] of case s[code] of
'+' : inc(code); '+' : inc(code);
'-' : begin '-' : begin
@ -919,8 +920,7 @@ begin
begin begin
{ Read integer part } { Read integer part }
flags:=flags or 1; flags:=flags or 1;
fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr*10+(ord(s[code])-ord('0'));
fpc_Val_Real_ShortStr:=fpc_Val_Real_ShortStr*10+(ord(s[code])-ord('0'));
inc(code); inc(code);
end; end;
{ Decimal ? } { Decimal ? }