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
31acbb4b
Commit
31acbb4b
authored
Dec 13, 2000
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 13, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FormatMessageA wasn't properly handling the %ls modifier.
parent
bc2ae78b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
format_msg.c
dlls/kernel/format_msg.c
+13
-8
No files found.
dlls/kernel/format_msg.c
View file @
31acbb4b
...
...
@@ -244,13 +244,10 @@ DWORD WINAPI FormatMessageA(
if
(
NULL
!=
(
x
=
strchr
(
f
,
'!'
)))
{
*
x
=
'\0'
;
fmtstr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
f
)
+
2
);
/* %ls ? */
if
(
!
strcmp
(
f
,
"ls"
))
f
++
;
sprintf
(
fmtstr
,
"%%%s"
,
f
);
f
=
x
+
1
;
}
else
{
fmtstr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
f
)
+
2
);
if
(
!
strcmp
(
f
,
"ls"
))
f
++
;
sprintf
(
fmtstr
,
"%%%s"
,
f
);
f
+=
strlen
(
f
);
/*at \0*/
}
...
...
@@ -261,17 +258,25 @@ DWORD WINAPI FormatMessageA(
fmtstr
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
"%s"
);
if
(
args
)
{
int
sz
;
LPSTR
b
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sz
=
100
)
;
LPSTR
b
;
if
(
dwFlags
&
FORMAT_MESSAGE_ARGUMENT_ARRAY
)
argliststart
=
args
+
insertnr
-
1
;
else
argliststart
=
(
*
(
DWORD
**
)
args
)
+
insertnr
-
1
;
/* CMF - This makes a BIG assumption about va_list */
while
(
vsnprintf
(
b
,
sz
,
fmtstr
,
(
va_list
)
argliststart
)
<
0
)
{
b
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
b
,
sz
+=
100
);
}
/* FIXME: precision and width components are not handled correctly */
if
(
strcmp
(
fmtstr
,
"%ls"
)
==
0
)
{
sz
=
WideCharToMultiByte
(
CP_ACP
,
0
,
*
(
WCHAR
**
)
argliststart
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
b
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
WideCharToMultiByte
(
CP_ACP
,
0
,
*
(
WCHAR
**
)
argliststart
,
-
1
,
b
,
sz
,
NULL
,
NULL
);
}
else
{
b
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sz
=
100
);
/* CMF - This makes a BIG assumption about va_list */
while
(
vsnprintf
(
b
,
sz
,
fmtstr
,
(
va_list
)
argliststart
)
<
0
)
{
b
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
b
,
sz
+=
100
);
}
}
for
(
x
=
b
;
*
x
;
x
++
)
ADD_TO_T
(
*
x
);
HeapFree
(
GetProcessHeap
(),
0
,
b
);
...
...
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