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
9a71b483
Commit
9a71b483
authored
Sep 25, 2006
by
Duane Clark
Committed by
Alexandre Julliard
Sep 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: fgetc needs to use unsigned parameters.
Spotted by and adapted from test written by Tobias Ringström.
parent
7a61a617
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
file.c
dlls/msvcrt/file.c
+3
-3
file.c
dlls/msvcrt/tests/file.c
+19
-0
No files found.
dlls/msvcrt/file.c
View file @
9a71b483
...
@@ -2127,12 +2127,12 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* file)
...
@@ -2127,12 +2127,12 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* file)
*/
*/
int
CDECL
MSVCRT_fgetc
(
MSVCRT_FILE
*
file
)
int
CDECL
MSVCRT_fgetc
(
MSVCRT_FILE
*
file
)
{
{
char
*
i
;
unsigned
char
*
i
;
int
j
;
unsigned
int
j
;
do
{
do
{
if
(
file
->
_cnt
>
0
)
{
if
(
file
->
_cnt
>
0
)
{
file
->
_cnt
--
;
file
->
_cnt
--
;
i
=
file
->
_ptr
++
;
i
=
(
unsigned
char
*
)
file
->
_ptr
++
;
j
=
*
i
;
j
=
*
i
;
}
else
}
else
j
=
MSVCRT__filbuf
(
file
);
j
=
MSVCRT__filbuf
(
file
);
...
...
dlls/msvcrt/tests/file.c
View file @
9a71b483
...
@@ -255,6 +255,24 @@ static WCHAR* AtoW( char* p )
...
@@ -255,6 +255,24 @@ static WCHAR* AtoW( char* p )
return
buffer
;
return
buffer
;
}
}
static
void
test_fgetc
(
void
)
{
char
*
tempf
;
FILE
*
tempfh
;
int
ich
=
0xe0
,
ret
;
tempf
=
_tempnam
(
"."
,
"wne"
);
tempfh
=
fopen
(
tempf
,
"w+"
);
fputc
(
ich
,
tempfh
);
fputc
(
ich
,
tempfh
);
rewind
(
tempfh
);
ret
=
fgetc
(
tempfh
);
ok
(
ich
==
ret
,
"First fgetc expected %x got %x
\n
"
,
ich
,
ret
);
ret
=
fgetc
(
tempfh
);
ok
(
ich
==
ret
,
"Second fgetc expected %x got %x
\n
"
,
ich
,
ret
);
fclose
(
tempfh
);
}
static
void
test_fgetwc
(
void
)
static
void
test_fgetwc
(
void
)
{
{
#define LLEN 512
#define LLEN 512
...
@@ -773,6 +791,7 @@ START_TEST(file)
...
@@ -773,6 +791,7 @@ START_TEST(file)
test_fileops
();
test_fileops
();
test_readmode
(
FALSE
);
/* binary mode */
test_readmode
(
FALSE
);
/* binary mode */
test_readmode
(
TRUE
);
/* ascii mode */
test_readmode
(
TRUE
);
/* ascii mode */
test_fgetc
();
test_fgetwc
();
test_fgetwc
();
test_ctrlz
();
test_ctrlz
();
test_file_put_get
();
test_file_put_get
();
...
...
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