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
db77f535
Commit
db77f535
authored
Nov 12, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix checks for digit characters.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4873dd49
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
vartest.c
dlls/oleaut32/tests/vartest.c
+6
-0
variant.c
dlls/oleaut32/variant.c
+8
-3
vartype.c
dlls/oleaut32/vartype.c
+1
-1
No files found.
dlls/oleaut32/tests/vartest.c
View file @
db77f535
...
...
@@ -1312,6 +1312,7 @@ static void test_VarParseNumFromStr(void)
LCID
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
NUMPARSE
np
;
BYTE
rgb
[
128
];
WCHAR
str
[
128
];
/** No flags **/
...
...
@@ -1734,6 +1735,11 @@ static void test_VarParseNumFromStr(void)
CONVERT
(
"0.10"
,
NUMPRS_STD
);
EXPECT
(
1
,
NUMPRS_STD
,
NUMPRS_DECIMAL
,
4
,
0
,
-
1
);
EXPECT2
(
1
,
0
);
str
[
0
]
=
0x0660
;
str
[
1
]
=
0
;
hres
=
pVarParseNumFromStr
(
str
,
lcid
,
LOCALE_NOUSEROVERRIDE
,
&
np
,
rgb
);
ok
(
hres
==
DISP_E_TYPEMISMATCH
,
"VarParseNumFromStr returned %08x
\n
"
,
hres
);
}
static
HRESULT
(
WINAPI
*
pVarNumFromParseNum
)(
NUMPARSE
*
,
BYTE
*
,
ULONG
,
VARIANT
*
);
...
...
dlls/oleaut32/variant.c
View file @
db77f535
...
...
@@ -1571,6 +1571,11 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
#define B_PROCESSING_HEX 0x20
#define B_PROCESSING_OCT 0x40
static
inline
BOOL
is_digit
(
WCHAR
c
)
{
return
'0'
<=
c
&&
c
<=
'9'
;
}
/**********************************************************************
* VarParseNumFromStr [OLEAUT32.46]
*
...
...
@@ -1714,14 +1719,14 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
while
(
*
lpszStr
)
{
if
(
is
w
digit
(
*
lpszStr
))
if
(
is
_
digit
(
*
lpszStr
))
{
if
(
dwState
&
B_PROCESSING_EXPONENT
)
{
int
exponentSize
=
0
;
if
(
dwState
&
B_EXPONENT_START
)
{
if
(
!
is
w
digit
(
*
lpszStr
))
if
(
!
is
_
digit
(
*
lpszStr
))
break
;
/* No exponent digits - invalid */
while
(
*
lpszStr
==
'0'
)
{
...
...
@@ -1731,7 +1736,7 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
}
}
while
(
is
w
digit
(
*
lpszStr
))
while
(
is
_
digit
(
*
lpszStr
))
{
exponentSize
*=
10
;
exponentSize
+=
*
lpszStr
-
'0'
;
...
...
dlls/oleaut32/vartype.c
View file @
db77f535
...
...
@@ -7657,7 +7657,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
/* Parse the string into our structure */
while
(
*
strIn
)
{
if
(
iswdigit
(
*
strIn
)
)
if
(
'0'
<=
*
strIn
&&
*
strIn
<=
'9'
)
{
if
(
dp
.
dwCount
>=
6
)
{
...
...
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