Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9915dd03
Commit
9915dd03
authored
Jul 22, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fixed strtod_l/wcstod_l implementation.
parent
c4bf9fb7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
string.c
dlls/msvcrt/string.c
+4
-1
string.c
dlls/msvcrt/tests/string.c
+5
-0
wcs.c
dlls/msvcrt/wcs.c
+4
-1
No files found.
dlls/msvcrt/string.c
View file @
9915dd03
...
...
@@ -169,6 +169,7 @@ double CDECL MSVCRT_strtod_l( const char *str, char **end, MSVCRT__locale_t loca
int
exp
=
0
,
sign
=
1
;
const
char
*
p
;
double
ret
;
BOOL
found_digit
=
FALSE
;
if
(
!
str
)
{
MSVCRT__invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
...
...
@@ -191,6 +192,7 @@ double CDECL MSVCRT_strtod_l( const char *str, char **end, MSVCRT__locale_t loca
p
++
;
while
(
isdigit
(
*
p
))
{
found_digit
=
TRUE
;
hlp
=
d
*
10
+*
(
p
++
)
-
'0'
;
if
(
d
>
MSVCRT_UI64_MAX
/
10
||
hlp
<
d
)
{
exp
++
;
...
...
@@ -207,6 +209,7 @@ double CDECL MSVCRT_strtod_l( const char *str, char **end, MSVCRT__locale_t loca
p
++
;
while
(
isdigit
(
*
p
))
{
found_digit
=
TRUE
;
hlp
=
d
*
10
+*
(
p
++
)
-
'0'
;
if
(
d
>
MSVCRT_UI64_MAX
/
10
||
hlp
<
d
)
break
;
...
...
@@ -217,7 +220,7 @@ double CDECL MSVCRT_strtod_l( const char *str, char **end, MSVCRT__locale_t loca
while
(
isdigit
(
*
p
))
p
++
;
if
(
p
==
str
)
{
if
(
!
found_digit
)
{
if
(
end
)
*
end
=
(
char
*
)
str
;
return
0
.
0
;
...
...
dlls/msvcrt/tests/string.c
View file @
9915dd03
...
...
@@ -1096,6 +1096,7 @@ static void test__strtod(void)
const
char
double4
[]
=
".21e12"
;
const
char
double5
[]
=
"214353e-3"
;
const
char
overflow
[]
=
"1d9999999999999999999"
;
const
char
white_chars
[]
=
" d10"
;
char
*
end
;
double
d
;
...
...
@@ -1123,6 +1124,10 @@ static void test__strtod(void)
d
=
strtod
(
"12.1d2"
,
NULL
);
ok
(
almost_equal
(
d
,
12.1e2
),
"d = %lf
\n
"
,
d
);
d
=
strtod
(
white_chars
,
&
end
);
ok
(
almost_equal
(
d
,
0
),
"d = %lf
\n
"
,
d
);
ok
(
end
==
white_chars
,
"incorrect end (%d)
\n
"
,
(
int
)(
end
-
white_chars
));
/* Set locale with non '.' decimal point (',') */
if
(
!
setlocale
(
LC_ALL
,
"Polish"
))
{
win_skip
(
"system with limited locales
\n
"
);
...
...
dlls/msvcrt/wcs.c
View file @
9915dd03
...
...
@@ -133,6 +133,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
int
exp
=
0
,
sign
=
1
;
const
MSVCRT_wchar_t
*
p
;
double
ret
;
BOOL
found_digit
=
FALSE
;
if
(
!
str
)
{
MSVCRT__invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
...
...
@@ -154,6 +155,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
p
++
;
while
(
isdigitW
(
*
p
))
{
found_digit
=
TRUE
;
hlp
=
d
*
10
+*
(
p
++
)
-
'0'
;
if
(
d
>
MSVCRT_UI64_MAX
/
10
||
hlp
<
d
)
{
exp
++
;
...
...
@@ -169,6 +171,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
p
++
;
while
(
isdigitW
(
*
p
))
{
found_digit
=
TRUE
;
hlp
=
d
*
10
+*
(
p
++
)
-
'0'
;
if
(
d
>
MSVCRT_UI64_MAX
/
10
||
hlp
<
d
)
break
;
...
...
@@ -179,7 +182,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
while
(
isdigitW
(
*
p
))
p
++
;
if
(
p
==
str
)
{
if
(
!
found_digit
)
{
if
(
end
)
*
end
=
(
MSVCRT_wchar_t
*
)
str
;
return
0
.
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment