mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 17:59:25 +02:00
* SScanf uses StrToFloat to convert the string to a float so it has to use DecimalSeparator to parse the string
* test adapted to use DecimalSeparator to create the test string git-svn-id: trunk@13399 -
This commit is contained in:
parent
87df99a53d
commit
ee49e8acb6
@ -2842,7 +2842,7 @@ function sscanf(const s: string; const fmt : string;const Pointers : array of Po
|
||||
while (Length(s) > n) and (s[n] = ' ') do
|
||||
inc(n);
|
||||
while (Length(s) >= n) and
|
||||
(s[n] in ['0'..'9', '+', '-', '.', 'e', 'E']) do
|
||||
(s[n] in ['0'..'9', '+', '-', DecimalSeparator, 'e', 'E']) do
|
||||
begin
|
||||
s1 := s1+s[n];
|
||||
inc(n);
|
||||
|
@ -7,7 +7,7 @@ var
|
||||
s : string;
|
||||
l : longint;
|
||||
begin
|
||||
sscanf('asdf 1.2345 1234','%s %f %d',[@s,@e,@l]);
|
||||
sscanf('asdf 1'+DecimalSeparator+'2345 1234','%s %f %d',[@s,@e,@l]);
|
||||
if (e<>1.2345) or
|
||||
(l<>1234) or
|
||||
(s<>'asdf') then
|
||||
|
Loading…
Reference in New Issue
Block a user