Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
aff5d2c1
Commit
aff5d2c1
authored
Feb 18, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't use isdigit in places where only 0-9 digits are handled.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52333e9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
string.c
dlls/msvcrt/string.c
+10
-10
wcs.c
dlls/msvcrt/wcs.c
+8
-8
No files found.
dlls/msvcrt/string.c
View file @
aff5d2c1
...
...
@@ -364,12 +364,12 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
}
#endif
while
(
isdigit
(
*
p
)
||
while
(
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
||
(
base
==
16
&&
((
*
p
>=
'a'
&&
*
p
<=
'f'
)
||
(
*
p
>=
'A'
&&
*
p
<=
'F'
))))
{
char
c
=
*
p
++
;
int
val
;
found_digit
=
TRUE
;
if
(
isdigit
(
c
)
)
if
(
c
>=
'0'
&&
c
<=
'9'
)
val
=
c
-
'0'
;
else
if
(
c
>=
'a'
&&
c
<=
'f'
)
val
=
10
+
c
-
'a'
;
...
...
@@ -382,7 +382,7 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
}
else
d
=
hlp
;
}
while
(
isdigit
(
*
p
)
||
while
(
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
||
(
base
==
16
&&
((
*
p
>=
'a'
&&
*
p
<=
'f'
)
||
(
*
p
>=
'A'
&&
*
p
<=
'F'
))))
{
exp
++
;
p
++
;
...
...
@@ -391,12 +391,12 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
if
(
*
p
==
*
locinfo
->
lconv
->
decimal_point
)
p
++
;
while
(
isdigit
(
*
p
)
||
while
(
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
||
(
base
==
16
&&
((
*
p
>=
'a'
&&
*
p
<=
'f'
)
||
(
*
p
>=
'A'
&&
*
p
<=
'F'
))))
{
char
c
=
*
p
++
;
int
val
;
found_digit
=
TRUE
;
if
(
isdigit
(
c
)
)
if
(
c
>=
'0'
&&
c
<=
'9'
)
val
=
c
-
'0'
;
else
if
(
c
>=
'a'
&&
c
<=
'f'
)
val
=
10
+
c
-
'a'
;
...
...
@@ -408,7 +408,7 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
d
=
hlp
;
exp
--
;
}
while
(
isdigit
(
*
p
)
||
while
(
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
||
(
base
==
16
&&
((
*
p
>=
'a'
&&
*
p
<=
'f'
)
||
(
*
p
>=
'A'
&&
*
p
<=
'F'
))))
p
++
;
...
...
@@ -432,8 +432,8 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
}
else
if
(
*
p
==
'+'
)
p
++
;
if
(
isdigit
(
*
p
)
)
{
while
(
isdigit
(
*
p
)
)
{
if
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
while
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
if
(
e
>
INT_MAX
/
10
||
(
e
=
e
*
10
+*
p
-
'0'
)
<
0
)
e
=
INT_MAX
;
p
++
;
...
...
@@ -925,7 +925,7 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, MSVCR
char
cur
=
tolower
(
*
nptr
);
int
v
;
if
(
isdigit
(
cur
)
)
{
if
(
cur
>=
'0'
&&
cur
<=
'9'
)
{
if
(
cur
>=
'0'
+
base
)
break
;
v
=
cur
-
'0'
;
...
...
@@ -1128,7 +1128,7 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b
char
cur
=
tolower
(
*
nptr
);
int
v
;
if
(
isdigit
(
cur
)
)
{
if
(
cur
>=
'0'
&&
cur
<=
'9'
)
{
if
(
cur
>=
'0'
+
base
)
break
;
v
=
*
nptr
-
'0'
;
...
...
dlls/msvcrt/wcs.c
View file @
aff5d2c1
...
...
@@ -374,7 +374,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
}
else
if
(
*
p
==
'+'
)
p
++
;
while
(
isdigitW
(
*
p
)
)
{
while
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
found_digit
=
TRUE
;
hlp
=
d
*
10
+*
(
p
++
)
-
'0'
;
if
(
d
>
MSVCRT_UI64_MAX
/
10
||
hlp
<
d
)
{
...
...
@@ -383,14 +383,14 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
}
else
d
=
hlp
;
}
while
(
isdigitW
(
*
p
)
)
{
while
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
exp
++
;
p
++
;
}
if
(
*
p
==
*
locinfo
->
lconv
->
decimal_point
)
p
++
;
while
(
isdigitW
(
*
p
)
)
{
while
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
found_digit
=
TRUE
;
hlp
=
d
*
10
+*
(
p
++
)
-
'0'
;
if
(
d
>
MSVCRT_UI64_MAX
/
10
||
hlp
<
d
)
...
...
@@ -399,7 +399,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
d
=
hlp
;
exp
--
;
}
while
(
isdigitW
(
*
p
)
)
while
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
p
++
;
if
(
!
found_digit
)
{
...
...
@@ -418,8 +418,8 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end,
}
else
if
(
*
p
==
'+'
)
p
++
;
if
(
isdigitW
(
*
p
)
)
{
while
(
isdigitW
(
*
p
)
)
{
if
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
while
(
*
p
>=
'0'
&&
*
p
<=
'9'
)
{
if
(
e
>
INT_MAX
/
10
||
(
e
=
e
*
10
+*
p
-
'0'
)
<
0
)
e
=
INT_MAX
;
p
++
;
...
...
@@ -1974,7 +1974,7 @@ __int64 CDECL MSVCRT__wcstoi64_l(const MSVCRT_wchar_t *nptr,
MSVCRT_wchar_t
cur
=
tolowerW
(
*
nptr
);
int
v
;
if
(
isdigitW
(
cur
)
)
{
if
(
cur
>=
'0'
&&
cur
<=
'9'
)
{
if
(
cur
>=
'0'
+
base
)
break
;
v
=
cur
-
'0'
;
...
...
@@ -2139,7 +2139,7 @@ unsigned __int64 CDECL MSVCRT__wcstoui64_l(const MSVCRT_wchar_t *nptr,
MSVCRT_wchar_t
cur
=
tolowerW
(
*
nptr
);
int
v
;
if
(
isdigitW
(
cur
)
)
{
if
(
cur
>=
'0'
&&
cur
<=
'9'
)
{
if
(
cur
>=
'0'
+
base
)
break
;
v
=
*
nptr
-
'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