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
1a260918
Commit
1a260918
authored
Dec 03, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/lcformat: Avoid back jumps on failure.
parent
ba9ccc51
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
lcformat.c
dlls/kernel32/lcformat.c
+20
-18
No files found.
dlls/kernel32/lcformat.c
View file @
1a260918
...
...
@@ -355,11 +355,7 @@ static INT NLS_GetDateTimeFormatW(LCID lcid, DWORD dwFlags,
/* Verify our arguments */
if
((
cchOut
&&
!
lpStr
)
||
!
(
node
=
NLS_GetFormats
(
lcid
,
dwFlags
)))
{
NLS_GetDateTimeFormatW_InvalidParameter:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
goto
invalid_parameter
;
if
(
dwFlags
&
~
(
DATE_DATEVARSONLY
|
TIME_TIMEVARSONLY
))
{
...
...
@@ -367,15 +363,13 @@ NLS_GetDateTimeFormatW_InvalidParameter:
((
dwFlags
&
DATE_DATEVARSONLY
&&
dwFlags
&
~
DATE_FORMAT_FLAGS
)
||
(
dwFlags
&
TIME_TIMEVARSONLY
&&
dwFlags
&
~
TIME_FORMAT_FLAGS
)))
{
NLS_GetDateTimeFormatW_InvalidFlags:
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
goto
invalid_flags
;
}
if
(
dwFlags
&
DATE_DATEVARSONLY
)
{
if
((
dwFlags
&
(
DATE_LTRREADING
|
DATE_RTLREADING
))
==
(
DATE_LTRREADING
|
DATE_RTLREADING
))
goto
NLS_GetDateTimeFormatW_InvalidF
lags
;
goto
invalid_f
lags
;
else
if
(
dwFlags
&
(
DATE_LTRREADING
|
DATE_RTLREADING
))
FIXME
(
"Unsupported flags: DATE_LTRREADING/DATE_RTLREADING
\n
"
);
...
...
@@ -387,10 +381,10 @@ NLS_GetDateTimeFormatW_InvalidFlags:
case
DATE_LONGDATE
:
case
DATE_YEARMONTH
:
if
(
lpFormat
)
goto
NLS_GetDateTimeFormatW_InvalidF
lags
;
goto
invalid_f
lags
;
break
;
default:
goto
NLS_GetDateTimeFormatW_InvalidF
lags
;
goto
invalid_f
lags
;
}
}
}
...
...
@@ -429,7 +423,7 @@ NLS_GetDateTimeFormatW_InvalidFlags:
st
.
wDay
=
lpTime
->
wDay
;
if
(
st
.
wDay
>
31
||
st
.
wMonth
>
12
||
!
SystemTimeToFileTime
(
&
st
,
&
ftTmp
))
goto
NLS_GetDateTimeFormatW_InvalidP
arameter
;
goto
invalid_p
arameter
;
FileTimeToSystemTime
(
&
ftTmp
,
&
st
);
lpTime
=
&
st
;
...
...
@@ -439,7 +433,7 @@ NLS_GetDateTimeFormatW_InvalidFlags:
{
/* Verify the time */
if
(
lpTime
->
wHour
>
24
||
lpTime
->
wMinute
>
59
||
lpTime
->
wSecond
>
59
)
goto
NLS_GetDateTimeFormatW_InvalidP
arameter
;
goto
invalid_p
arameter
;
}
}
...
...
@@ -464,7 +458,7 @@ NLS_GetDateTimeFormatW_InvalidFlags:
if
(
!
cchOut
)
cchWritten
++
;
/* Count size only */
else
if
(
cchWritten
>=
cchOut
)
goto
NLS_GetDateTimeFormatW_O
verrun
;
goto
o
verrun
;
else
if
(
!
bSkipping
)
{
lpStr
[
cchWritten
]
=
*
lpFormat
;
...
...
@@ -624,7 +618,7 @@ NLS_GetDateTimeFormatW_InvalidFlags:
else
{
memcpy
(
lpStr
+
cchWritten
,
szAdd
,
(
cchOut
-
cchWritten
)
*
sizeof
(
WCHAR
));
goto
NLS_GetDateTimeFormatW_O
verrun
;
goto
o
verrun
;
}
}
cchWritten
+=
dwLen
;
...
...
@@ -636,7 +630,7 @@ NLS_GetDateTimeFormatW_InvalidFlags:
if
(
!
cchOut
)
cchWritten
++
;
/* Count size only */
else
if
(
cchWritten
>=
cchOut
)
goto
NLS_GetDateTimeFormatW_O
verrun
;
goto
o
verrun
;
else
if
(
!
bSkipping
||
*
lpFormat
==
' '
)
{
lpStr
[
cchWritten
]
=
*
lpFormat
;
...
...
@@ -650,7 +644,7 @@ NLS_GetDateTimeFormatW_InvalidFlags:
if
(
cchOut
)
{
if
(
cchWritten
>=
cchOut
)
goto
NLS_GetDateTimeFormatW_O
verrun
;
goto
o
verrun
;
else
lpStr
[
cchWritten
]
=
'\0'
;
}
...
...
@@ -659,10 +653,18 @@ NLS_GetDateTimeFormatW_InvalidFlags:
TRACE
(
"returning length=%d, ouput=%s
\n
"
,
cchWritten
,
debugstr_w
(
lpStr
));
return
cchWritten
;
NLS_GetDateTimeFormatW_O
verrun:
o
verrun:
TRACE
(
"returning 0, (ERROR_INSUFFICIENT_BUFFER)
\n
"
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
0
;
invalid_parameter:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
invalid_flags:
SetLastError
(
ERROR_INVALID_FLAGS
);
return
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