Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Herman Semenov
wine
Commits
419f9025
Commit
419f9025
authored
14 years ago
by
Piotr Caban
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msvcrt: Format strings according to specified locale in pf_vsnprintf.
parent
d8504e05
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/msvcrt/wcs.c
+11
-4
11 additions, 4 deletions
dlls/msvcrt/wcs.c
with
11 additions
and
4 deletions
dlls/msvcrt/wcs.c
+
11
−
4
View file @
419f9025
...
...
@@ -554,12 +554,15 @@ static void pf_fixup_exponent( char *buf )
*
* implements both A and W vsnprintf functions
*/
static
int
pf_vsnprintf
(
pf_output
*
out
,
const
WCHAR
*
format
,
__ms_va_list
valist
)
static
int
pf_vsnprintf
(
pf_output
*
out
,
const
WCHAR
*
format
,
MSVCRT__locale_t
locale
,
__ms_va_list
valist
)
{
int
r
;
LPCWSTR
q
,
p
=
format
;
pf_flags
flags
;
if
(
!
locale
)
locale
=
get_locale
();
TRACE
(
"format is %s
\n
"
,
debugstr_w
(
format
));
while
(
*
p
)
{
...
...
@@ -751,7 +754,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis
/* deal with integers and floats using libc's printf */
else
if
(
pf_is_valid_format
(
flags
.
Format
)
)
{
char
fmt
[
20
],
number
[
40
],
*
x
=
number
;
char
fmt
[
20
],
number
[
40
],
*
x
=
number
,
*
decimal_point
;
/* Estimate largest possible required buffer size:
* Chooses the larger of the field or precision
...
...
@@ -775,6 +778,10 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis
else
sprintf
(
x
,
fmt
,
va_arg
(
valist
,
int
)
);
decimal_point
=
strchr
(
x
,
'.'
);
if
(
decimal_point
)
*
decimal_point
=
*
locale
->
locinfo
->
lconv
->
decimal_point
;
r
=
pf_output_stringA
(
out
,
x
,
-
1
);
if
(
x
!=
number
)
HeapFree
(
GetProcessHeap
(),
0
,
x
);
...
...
@@ -814,7 +821,7 @@ int CDECL MSVCRT_vsnprintf( char *str, unsigned int len,
formatW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
format
,
-
1
,
formatW
,
sz
);
r
=
pf_vsnprintf
(
&
out
,
formatW
,
valist
);
r
=
pf_vsnprintf
(
&
out
,
formatW
,
NULL
,
valist
);
HeapFree
(
GetProcessHeap
(),
0
,
formatW
);
...
...
@@ -871,7 +878,7 @@ int CDECL MSVCRT_vsnwprintf( MSVCRT_wchar_t *str, unsigned int len,
out
.
used
=
0
;
out
.
len
=
len
;
return
pf_vsnprintf
(
&
out
,
format
,
valist
);
return
pf_vsnprintf
(
&
out
,
format
,
NULL
,
valist
);
}
/*********************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment