Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3c2dc4a7
Commit
3c2dc4a7
authored
Dec 20, 2013
by
Sebastian Lackner
Committed by
Alexandre Julliard
Dec 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow passing NULL buffer to printf functions.
parent
73edf080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
printf.c
dlls/ntdll/printf.c
+14
-8
No files found.
dlls/ntdll/printf.c
View file @
3c2dc4a7
...
...
@@ -75,16 +75,17 @@ static inline int pf_output_stringW( pf_output *out, LPCWSTR str, int len )
if
(
out
->
unicode
)
{
LPWSTR
p
=
out
->
buf
.
W
+
out
->
used
;
out
->
used
+=
len
;
if
(
!
out
->
buf
.
W
)
return
len
;
if
(
space
>=
len
)
{
memcpy
(
p
,
str
,
len
*
sizeof
(
WCHAR
)
);
out
->
used
+=
len
;
return
len
;
}
if
(
space
>
0
)
memcpy
(
p
,
str
,
space
*
sizeof
(
WCHAR
)
);
out
->
used
+=
len
;
}
else
{
...
...
@@ -92,14 +93,16 @@ static inline int pf_output_stringW( pf_output *out, LPCWSTR str, int len )
ULONG
n
;
RtlUnicodeToMultiByteSize
(
&
n
,
str
,
len
*
sizeof
(
WCHAR
)
);
out
->
used
+=
n
;
if
(
!
out
->
buf
.
A
)
return
len
;
if
(
space
>=
n
)
{
RtlUnicodeToMultiByteN
(
p
,
n
,
NULL
,
str
,
len
*
sizeof
(
WCHAR
)
);
out
->
used
+=
n
;
return
len
;
}
if
(
space
>
0
)
RtlUnicodeToMultiByteN
(
p
,
space
,
NULL
,
str
,
len
*
sizeof
(
WCHAR
)
);
out
->
used
+=
n
;
}
return
-
1
;
}
...
...
@@ -113,16 +116,17 @@ static inline int pf_output_stringA( pf_output *out, LPCSTR str, int len )
if
(
!
out
->
unicode
)
{
LPSTR
p
=
out
->
buf
.
A
+
out
->
used
;
out
->
used
+=
len
;
if
(
!
out
->
buf
.
A
)
return
len
;
if
(
space
>=
len
)
{
memcpy
(
p
,
str
,
len
);
out
->
used
+=
len
;
return
len
;
}
if
(
space
>
0
)
memcpy
(
p
,
str
,
space
);
out
->
used
+=
len
;
}
else
{
...
...
@@ -130,14 +134,16 @@ static inline int pf_output_stringA( pf_output *out, LPCSTR str, int len )
ULONG
n
;
RtlMultiByteToUnicodeSize
(
&
n
,
str
,
len
);
out
->
used
+=
n
/
sizeof
(
WCHAR
);
if
(
!
out
->
buf
.
W
)
return
len
;
if
(
space
>=
n
/
sizeof
(
WCHAR
))
{
RtlMultiByteToUnicodeN
(
p
,
n
,
NULL
,
str
,
len
);
out
->
used
+=
n
/
sizeof
(
WCHAR
);
return
len
;
}
if
(
space
>
0
)
RtlMultiByteToUnicodeN
(
p
,
space
*
sizeof
(
WCHAR
),
NULL
,
str
,
len
);
out
->
used
+=
n
/
sizeof
(
WCHAR
);
}
return
-
1
;
}
...
...
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