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
c3979308
Commit
c3979308
authored
Feb 07, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Handle negative file->_cnt value in _flsbuf function.
parent
9d538e43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
file.c
dlls/msvcrt/file.c
+1
-1
file.c
dlls/msvcrt/tests/file.c
+13
-2
No files found.
dlls/msvcrt/file.c
View file @
c3979308
...
...
@@ -3088,7 +3088,7 @@ 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
;
...
...
dlls/msvcrt/tests/file.c
View file @
c3979308
...
...
@@ -544,10 +544,21 @@ static void test_flsbuf( void )
bufmodes
[
bufmode
],
0
,
ret
);
ret
=
_flsbuf
(
0xff
,
tempfh
);
ok
(
0xff
==
ret
,
"_flsbuf(0xff,tempfh) with bufmode %x expected %x got %x
\n
"
,
bufmodes
[
bufmode
],
0
,
ret
);
bufmodes
[
bufmode
],
0
xff
,
ret
);
ret
=
_flsbuf
(
0xffffffff
,
tempfh
);
ok
(
0xff
==
ret
,
"_flsbuf(0xffffffff,tempfh) with bufmode %x expected %x got %x
\n
"
,
bufmodes
[
bufmode
],
0
,
ret
);
bufmodes
[
bufmode
],
0xff
,
ret
);
if
(
tempfh
->
_base
)
{
fputc
(
'x'
,
tempfh
);
tempfh
->
_cnt
=
-
1
;
tempfh
->
_base
[
1
]
=
'a'
;
ret
=
_flsbuf
(
0xab
,
tempfh
);
ok
(
ret
==
0xab
,
"_flsbuf(0xab,tempfh) with bufmode %x expected 0xab got %x
\n
"
,
bufmodes
[
bufmode
],
ret
);
ok
(
tempfh
->
_base
[
1
]
==
'a'
,
"tempfh->_base[1] should not be changed (%d)
\n
"
,
tempfh
->
_base
[
1
]);
}
fclose
(
tempfh
);
}
...
...
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