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
d56113cd
Commit
d56113cd
authored
Jun 07, 2010
by
Alexander Scott-Johns
Committed by
Alexandre Julliard
Jun 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: The sizeOfBuffer argument of _vsnwprintf_s is measured in wide characters, not bytes.
parent
4e8e2f39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
wcs.c
dlls/msvcrt/wcs.c
+7
-9
No files found.
dlls/msvcrt/wcs.c
View file @
d56113cd
...
...
@@ -1147,17 +1147,17 @@ int CDECL MSVCRT_vsnwprintf_s_l( MSVCRT_wchar_t *str, MSVCRT_size_t sizeOfBuffer
{
int
len
,
ret
;
len
=
sizeOfBuffer
/
sizeof
(
MSVCRT_wchar_t
)
;
len
=
sizeOfBuffer
;
if
(
count
!=-
1
&&
len
>
count
+
1
)
len
=
count
+
1
;
ret
=
vsnwprintf_internal
(
str
,
len
,
format
,
locale
,
TRUE
,
valist
);
if
(
ret
<
0
||
ret
==
len
)
{
if
(
count
!=
MSVCRT__TRUNCATE
&&
count
>
sizeOfBuffer
/
sizeof
(
MSVCRT_wchar_t
)
)
{
if
(
count
!=
MSVCRT__TRUNCATE
&&
count
>
sizeOfBuffer
)
{
MSVCRT__invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
memset
(
str
,
0
,
sizeOfBuffer
);
memset
(
str
,
0
,
sizeOfBuffer
*
sizeof
(
MSVCRT_wchar_t
)
);
}
else
str
[
len
-
1
]
=
'\0'
;
...
...
@@ -1242,8 +1242,7 @@ int CDECL MSVCRT_swprintf_s(MSVCRT_wchar_t *str, MSVCRT_size_t numberOfElements,
int
r
;
__ms_va_start
(
ap
,
format
);
r
=
MSVCRT_vsnwprintf_s
(
str
,
numberOfElements
*
sizeof
(
MSVCRT_wchar_t
),
INT_MAX
,
format
,
ap
);
r
=
MSVCRT_vsnwprintf_s
(
str
,
numberOfElements
,
INT_MAX
,
format
,
ap
);
__ms_va_end
(
ap
);
return
r
;
...
...
@@ -1271,8 +1270,7 @@ int CDECL _vscwprintf( const MSVCRT_wchar_t *format, __ms_va_list args )
int
CDECL
MSVCRT_vswprintf_s
(
MSVCRT_wchar_t
*
str
,
MSVCRT_size_t
numberOfElements
,
const
MSVCRT_wchar_t
*
format
,
__ms_va_list
args
)
{
return
MSVCRT_vsnwprintf_s
(
str
,
numberOfElements
*
sizeof
(
MSVCRT_wchar_t
),
INT_MAX
,
format
,
args
);
return
MSVCRT_vsnwprintf_s
(
str
,
numberOfElements
,
INT_MAX
,
format
,
args
);
}
/*********************************************************************
...
...
@@ -1281,8 +1279,8 @@ int CDECL MSVCRT_vswprintf_s(MSVCRT_wchar_t* str, MSVCRT_size_t numberOfElements
int
CDECL
MSVCRT_vswprintf_s_l
(
MSVCRT_wchar_t
*
str
,
MSVCRT_size_t
numberOfElements
,
const
MSVCRT_wchar_t
*
format
,
MSVCRT__locale_t
locale
,
__ms_va_list
args
)
{
return
MSVCRT_vsnwprintf_s_l
(
str
,
numberOfElements
*
sizeof
(
MSVCRT_wchar_t
)
,
INT_MAX
,
format
,
locale
,
args
);
return
MSVCRT_vsnwprintf_s_l
(
str
,
numberOfElements
,
INT_MAX
,
format
,
locale
,
args
);
}
/*********************************************************************
...
...
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