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
180326bb
Commit
180326bb
authored
Dec 21, 2005
by
Jesse Allen
Committed by
Alexandre Julliard
Dec 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix printf sign flags.
Fix the printf sign flags so that '+' doesn't always override ' ' space alone. If they both appear, continue parsing and let '+' take precedence.
parent
bd298b51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
printf.c
dlls/msvcrt/tests/printf.c
+10
-0
wcs.c
dlls/msvcrt/wcs.c
+4
-1
No files found.
dlls/msvcrt/tests/printf.c
View file @
180326bb
...
@@ -56,6 +56,16 @@ static void test_sprintf( void )
...
@@ -56,6 +56,16 @@ static void test_sprintf( void )
ok
(
!
strcmp
(
buffer
,
"I"
),
"Problem with
\"
I
\"
interpretation
\n
"
);
ok
(
!
strcmp
(
buffer
,
"I"
),
"Problem with
\"
I
\"
interpretation
\n
"
);
ok
(
r
==
1
,
"return count wrong
\n
"
);
ok
(
r
==
1
,
"return count wrong
\n
"
);
format
=
"% d"
;
r
=
sprintf
(
buffer
,
format
,
1
);
ok
(
!
strcmp
(
buffer
,
" 1"
),
"Problem with sign place-holder: '%s'
\n
"
,
buffer
);
ok
(
r
==
2
,
"return count wrong
\n
"
);
format
=
"%+ d"
;
r
=
sprintf
(
buffer
,
format
,
1
);
ok
(
!
strcmp
(
buffer
,
"+1"
),
"Problem with sign flags: '%s'
\n
"
,
buffer
);
ok
(
r
==
2
,
"return count wrong
\n
"
);
format
=
"%S"
;
format
=
"%S"
;
r
=
sprintf
(
buffer
,
format
,
wide
);
r
=
sprintf
(
buffer
,
format
,
wide
);
ok
(
!
strcmp
(
buffer
,
"wide"
),
"Problem with wide string format
\n
"
);
ok
(
!
strcmp
(
buffer
,
"wide"
),
"Problem with wide string format
\n
"
);
...
...
dlls/msvcrt/wcs.c
View file @
180326bb
...
@@ -438,7 +438,10 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
...
@@ -438,7 +438,10 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
while
(
*
p
)
while
(
*
p
)
{
{
if
(
*
p
==
'+'
||
*
p
==
' '
)
if
(
*
p
==
'+'
||
*
p
==
' '
)
flags
.
Sign
=
'+'
;
{
if
(
flags
.
Sign
!=
'+'
)
flags
.
Sign
=
*
p
;
}
else
if
(
*
p
==
'-'
)
else
if
(
*
p
==
'-'
)
flags
.
LeftAlign
=
*
p
;
flags
.
LeftAlign
=
*
p
;
else
if
(
*
p
==
'0'
)
else
if
(
*
p
==
'0'
)
...
...
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