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
373604f2
Commit
373604f2
authored
May 17, 2017
by
Akihiro Sagawa
Committed by
Alexandre Julliard
May 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xcopy: Avoid using isdigit() for WCHARs.
Found with Coccinelle. Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
505be073
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
xcopy.c
programs/xcopy/xcopy.c
+10
-5
No files found.
programs/xcopy/xcopy.c
View file @
373604f2
...
...
@@ -643,7 +643,7 @@ cleanup:
/* =========================================================================
XCOPY_ParseCommandLine - Parses the command line
========================================================================= */
static
BOOL
is_whitespace
(
WCHAR
c
)
static
inline
BOOL
is_whitespace
(
WCHAR
c
)
{
return
c
==
' '
||
c
==
'\t'
;
}
...
...
@@ -654,6 +654,11 @@ static WCHAR *skip_whitespace(WCHAR *p)
return
p
;
}
static
inline
BOOL
is_digit
(
WCHAR
c
)
{
return
c
>=
'0'
&&
c
<=
'9'
;
}
/* Windows XCOPY uses a simplified command line parsing algorithm
that lacks the escaped-quote logic of build_argv(), because
literal double quotes are illegal in any of its arguments.
...
...
@@ -770,7 +775,7 @@ static int XCOPY_ParseCommandLine(WCHAR *suppliedsource,
break
;
/* D can be /D or /D: */
case
'D'
:
if
(
word
[
2
]
==
':'
&&
isdigit
(
word
[
3
]))
{
case
'D'
:
if
(
word
[
2
]
==
':'
&&
is
_
digit
(
word
[
3
]))
{
SYSTEMTIME
st
;
WCHAR
*
pos
=
&
word
[
3
];
BOOL
isError
=
FALSE
;
...
...
@@ -781,18 +786,18 @@ static int XCOPY_ParseCommandLine(WCHAR *suppliedsource,
* It is hardcoded to month-day-year.
*/
st
.
wMonth
=
_wtol
(
pos
);
while
(
*
pos
&&
isdigit
(
*
pos
))
pos
++
;
while
(
*
pos
&&
is
_
digit
(
*
pos
))
pos
++
;
if
(
*
pos
++
!=
'-'
)
isError
=
TRUE
;
if
(
!
isError
)
{
st
.
wDay
=
_wtol
(
pos
);
while
(
*
pos
&&
isdigit
(
*
pos
))
pos
++
;
while
(
*
pos
&&
is
_
digit
(
*
pos
))
pos
++
;
if
(
*
pos
++
!=
'-'
)
isError
=
TRUE
;
}
if
(
!
isError
)
{
st
.
wYear
=
_wtol
(
pos
);
while
(
*
pos
&&
isdigit
(
*
pos
))
pos
++
;
while
(
*
pos
&&
is
_
digit
(
*
pos
))
pos
++
;
if
(
st
.
wYear
<
100
)
st
.
wYear
+=
2000
;
}
...
...
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