Browse Source

* 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 -

florian 16 years ago
parent
commit
ee49e8acb6
2 changed files with 2 additions and 2 deletions
  1. 1 1
      rtl/objpas/sysutils/sysstr.inc
  2. 1 1
      tests/test/units/sysutils/tsscanf.pp

+ 1 - 1
rtl/objpas/sysutils/sysstr.inc

@@ -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);

+ 1 - 1
tests/test/units/sysutils/tsscanf.pp

@@ -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