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
0fb9ef68
Commit
0fb9ef68
authored
Feb 25, 2005
by
Uwe Bonnes
Committed by
Alexandre Julliard
Feb 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Advance over * argument for precision.
Honor precision argument for strings.
parent
20894e2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
printf.c
dlls/msvcrt/tests/printf.c
+10
-0
wcs.c
dlls/msvcrt/wcs.c
+9
-0
No files found.
dlls/msvcrt/tests/printf.c
View file @
0fb9ef68
...
...
@@ -76,6 +76,16 @@ static void test_sprintf( void )
ok
(
!
strcmp
(
buffer
,
"0foo"
),
"String not zero-prefixed
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
4
,
"return count wrong
\n
"
);
format
=
"%.1s"
;
r
=
sprintf
(
buffer
,
format
,
"foo"
);
ok
(
!
strcmp
(
buffer
,
"f"
),
"Precision ignored
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
1
,
"return count wrong
\n
"
);
format
=
"%.*s"
;
r
=
sprintf
(
buffer
,
format
,
1
,
"foo"
);
ok
(
!
strcmp
(
buffer
,
"f"
),
"Precision ignored
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
1
,
"return count wrong
\n
"
);
format
=
"%#-012p"
;
r
=
sprintf
(
buffer
,
format
,(
void
*
)
57
);
ok
(
!
strcmp
(
buffer
,
"0X00000039 "
),
"Pointer formatted incorrectly
\n
"
);
...
...
dlls/msvcrt/wcs.c
View file @
0fb9ef68
...
...
@@ -309,6 +309,9 @@ static inline int pf_output_format_W( pf_output *out, LPCWSTR str,
if
(
len
<
0
)
len
=
strlenW
(
str
);
if
(
flags
->
Precision
&&
flags
->
Precision
<
len
)
len
=
flags
->
Precision
;
r
=
pf_fill
(
out
,
len
,
flags
,
1
);
if
(
r
>=
0
)
...
...
@@ -328,6 +331,9 @@ static inline int pf_output_format_A( pf_output *out, LPCSTR str,
if
(
len
<
0
)
len
=
strlen
(
str
);
if
(
flags
->
Precision
&&
flags
->
Precision
<
len
)
len
=
flags
->
Precision
;
r
=
pf_fill
(
out
,
len
,
flags
,
1
);
if
(
r
>=
0
)
...
...
@@ -461,7 +467,10 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
{
p
++
;
if
(
*
p
==
'*'
)
{
flags
.
Precision
=
va_arg
(
valist
,
int
);
p
++
;
}
else
while
(
isdigit
(
*
p
)
)
{
flags
.
Precision
*=
10
;
...
...
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