fix so fread return right value of bytes/chars it reads

make one more wine test pass in msvcrt file

svn path=/trunk/; revision=22155
This commit is contained in:
Magnus Olsen 2006-06-01 18:20:34 +00:00
parent 20c6fb757f
commit b1fe06cdfe

View file

@ -81,5 +81,8 @@ size_t fread(void *vptr, size_t size, size_t count, FILE *iop)
}
}
}
return count - (to_read/size);
// return count - (to_read/size)
/* FIXME is this formual right ?, I copy the formula from djgpp
in our to_read or copy ? */
return size != 0 ? count - ((to_read + size - 1) / size) : 0;
}