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
c6a16069
Commit
c6a16069
authored
Jun 18, 2014
by
Grazvydas Ignotas
Committed by
Alexandre Julliard
Jun 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Clear _cnt on buffer flush.
parent
61d49a8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
file.c
dlls/msvcrt/file.c
+8
-7
file.c
dlls/msvcrt/tests/file.c
+1
-1
No files found.
dlls/msvcrt/file.c
View file @
c6a16069
...
...
@@ -595,7 +595,7 @@ static int msvcrt_flush_buffer(MSVCRT_FILE* file)
return
MSVCRT_EOF
;
}
file
->
_ptr
=
file
->
_base
;
file
->
_cnt
=
file
->
_bufsiz
;
file
->
_cnt
=
0
;
}
return
0
;
}
...
...
@@ -3659,14 +3659,15 @@ int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file)
if
(
file
->
_bufsiz
)
{
int
res
=
0
;
if
(
file
->
_cnt
<=
0
)
if
(
file
->
_cnt
<=
0
)
{
res
=
msvcrt_flush_buffer
(
file
);
if
(
!
res
)
{
*
file
->
_ptr
++
=
c
;
file
->
_cnt
--
;
if
(
res
)
return
res
;
file
->
_cnt
=
file
->
_bufsiz
;
}
return
res
?
res
:
c
&
0xff
;
*
file
->
_ptr
++
=
c
;
file
->
_cnt
--
;
return
c
&
0xff
;
}
else
{
unsigned
char
cc
=
c
;
int
len
;
...
...
dlls/msvcrt/tests/file.c
View file @
c6a16069
...
...
@@ -2239,7 +2239,7 @@ static void test_write_flush_size(FILE *file, int bufsize)
*/
lseek
(
fd
,
1
,
SEEK_SET
);
fflush
(
file
);
todo_wine
ok
(
file
->
_cnt
==
0
,
"_cnt should be 0 after fflush, but is %d
\n
"
,
file
->
_cnt
);
ok
(
file
->
_cnt
==
0
,
"_cnt should be 0 after fflush, but is %d
\n
"
,
file
->
_cnt
);
fseek
(
file
,
0
,
SEEK_SET
);
ok
(
fread
(
inbuffer
,
1
,
bufsize
,
file
)
==
bufsize
,
"read failed
\n
"
);
if
(
size
==
bufsize
)
...
...
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