[PATCH] Fixes a crash with mingw32-make Looking at the rest of the code it looks like it's possible for _cnt to be less than 0

Ben Mayhew ben-dev at gmx.net
Tue Jul 29 14:39:44 CDT 2008


---
 dlls/msvcrt/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index cd15e40..1d7f536 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -2398,7 +2398,7 @@ MSVCRT_size_t CDECL MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_si
   int written = 0;
   if (size == 0)
       return 0;
-  if(file->_cnt) {
+  if(file->_cnt > 0) {
 	int pcnt=(file->_cnt>wrcnt)? wrcnt: file->_cnt;
 	memcpy(file->_ptr, ptr, pcnt);
 	file->_cnt -= pcnt;
-- 
1.5.4.3


--------------070701030804030306000608--



More information about the wine-patches mailing list