MSVCRT: Allow reading 0 bytes in fread

Felix Nawothnig felix.nawothnig at t-online.de
Sun Jul 10 04:42:19 CDT 2005


This causes a division by zero before - TinyIRC starts now.

ChangeLog:
Allow reading 0 bytes in fread
-------------- next part --------------
Index: dlls/msvcrt/file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/file.c,v
retrieving revision 1.87
diff -u -r1.87 file.c
--- dlls/msvcrt/file.c	25 Jun 2005 17:58:19 -0000	1.87
+++ dlls/msvcrt/file.c	10 Jul 2005 09:40:28 -0000
@@ -2482,6 +2482,9 @@
   MSVCRT_size_t read=0;
   int pread=0;
 
+  if(!rcnt)
+	return 0;
+
   /* first buffered data */
   if(file->_cnt>0) {
 	int pcnt= (rcnt>file->_cnt)? file->_cnt:rcnt;


More information about the wine-patches mailing list