mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 22:49:17 +02:00
* 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:
parent
a2f4c7fd2a
commit
697875f5af
@ -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 ? }
|
||||||
|
Loading…
Reference in New Issue
Block a user