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
0cc16fc8
Commit
0cc16fc8
authored
Apr 16, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fixed 'h' modifier handling when printing integers.
parent
5c9ca5cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
printf.h
dlls/msvcrt/printf.h
+6
-4
printf.c
dlls/msvcrt/tests/printf.c
+10
-0
No files found.
dlls/msvcrt/printf.h
View file @
0cc16fc8
...
...
@@ -525,11 +525,13 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
FUNC_NAME
(
pf_integer_conv
)(
tmp
,
max_len
,
&
flags
,
pf_args
(
args_ctx
,
pos
,
VT_I8
,
valist
).
get_longlong
);
else
if
(
flags
.
Format
==
'd'
||
flags
.
Format
==
'i'
)
FUNC_NAME
(
pf_integer_conv
)(
tmp
,
max_len
,
&
flags
,
pf_args
(
args_ctx
,
pos
,
VT_INT
,
valist
).
get_int
);
FUNC_NAME
(
pf_integer_conv
)(
tmp
,
max_len
,
&
flags
,
flags
.
IntegerLength
!=
'h'
?
pf_args
(
args_ctx
,
pos
,
VT_INT
,
valist
).
get_int
:
(
short
)
pf_args
(
args_ctx
,
pos
,
VT_INT
,
valist
).
get_int
);
else
FUNC_NAME
(
pf_integer_conv
)(
tmp
,
max_len
,
&
flags
,
(
unsigned
)
pf_args
(
args_ctx
,
pos
,
VT_INT
,
valist
).
get_int
);
FUNC_NAME
(
pf_integer_conv
)(
tmp
,
max_len
,
&
flags
,
flags
.
IntegerLength
!=
'h'
?
(
unsigned
)
pf_args
(
args_ctx
,
pos
,
VT_INT
,
valist
).
get_int
:
(
unsigned
short
)
pf_args
(
args_ctx
,
pos
,
VT_INT
,
valist
).
get_int
);
#ifdef PRINTF_WIDE
i
=
FUNC_NAME
(
pf_output_format_wstr
)(
pf_puts
,
puts_ctx
,
tmp
,
-
1
,
&
flags
,
locinfo
);
...
...
dlls/msvcrt/tests/printf.c
View file @
0cc16fc8
...
...
@@ -607,6 +607,16 @@ static void test_sprintf( void )
r
=
sprintf
(
buffer
,
format
);
ok
(
!
strcmp
(
buffer
,
"%0"
),
"failed:
\"
%s
\"\n
"
,
buffer
);
ok
(
r
==
2
,
"return count wrong
\n
"
);
format
=
"%hx"
;
r
=
sprintf
(
buffer
,
format
,
0x12345
);
ok
(
!
strcmp
(
buffer
,
"2345"
),
"failed
\"
%s
\"\n
"
,
buffer
);
format
=
"%hhx"
;
r
=
sprintf
(
buffer
,
format
,
0x123
);
ok
(
!
strcmp
(
buffer
,
"123"
),
"failed:
\"
%s
\"\n
"
,
buffer
);
r
=
sprintf
(
buffer
,
format
,
0x12345
);
ok
(
!
strcmp
(
buffer
,
"2345"
),
"failed
\"
%s
\"\n
"
,
buffer
);
}
static
void
test_swprintf
(
void
)
...
...
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