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
5a3695cc
Commit
5a3695cc
authored
Jan 04, 2012
by
Daniel Lehman
Committed by
Alexandre Julliard
Jan 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Make WEOF returned from swscanf signed.
parent
739bd884
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
scanf.h
dlls/msvcrt/scanf.h
+1
-1
scanf.c
dlls/msvcrt/tests/scanf.c
+17
-0
No files found.
dlls/msvcrt/scanf.h
View file @
5a3695cc
...
...
@@ -26,7 +26,7 @@
#ifdef WIDE_SCANF
#define _CHAR_ MSVCRT_wchar_t
#define _EOF_ MSVCRT_WEOF
#define _EOF_RET MSVCRT_WEOF
#define _EOF_RET
(short)
MSVCRT_WEOF
#define _ISSPACE_(c) MSVCRT_iswspace(c)
#define _ISDIGIT_(c) MSVCRT_iswdigit(c)
#define _WIDE2SUPPORTED_(c) c
/* No conversion needed (wide to wide) */
...
...
dlls/msvcrt/tests/scanf.c
View file @
5a3695cc
...
...
@@ -243,8 +243,25 @@ static void test_sscanf_s(void)
ok
(
i
==
123
,
"i = %d
\n
"
,
i
);
}
static
void
test_swscanf
(
void
)
{
wchar_t
buffer
[
100
];
int
result
,
ret
;
static
const
WCHAR
formatd
[]
=
{
'%'
,
'd'
,
0
};
/* check WEOF */
/* WEOF is an unsigned short -1 but swscanf returns int
so it should be sign-extended */
buffer
[
0
]
=
0
;
ret
=
swscanf
(
buffer
,
formatd
,
&
result
);
/* msvcrt returns 0 but should return -1 (later versions do) */
ok
(
ret
==
(
short
)
WEOF
||
broken
(
ret
==
0
),
"swscanf returns %x instead of %x
\n
"
,
ret
,
WEOF
);
}
START_TEST
(
scanf
)
{
test_sscanf
();
test_sscanf_s
();
test_swscanf
();
}
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