[PATCH] Do not break buffers in fvwrite for unbuffered files

Corinna Vinschen vinschen@redhat.com
Mon Oct 21 11:54:00 GMT 2013


On Oct 21 10:36, Federico wrote:
> -	  w = fp->_write (ptr, fp->_cookie, p, MIN (len, BUFSIZ));
> +	  w = fp->_write (ptr, fp->_cookie, p, len);

As noted in my other reply, len is size_t but the parameter to _write
may be int, even after my _READ_WRITE_BUFSIZE_TYPE patch has been applied.

Therefore the type size difference still has to be accounted for.
Maybe something like this is sufficient:

  w = fp->_write (ptr, fp->_cookie, p, MIN (len, MAX_INT));

???


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20131021/0d1f2ec1/attachment.sig>


More information about the Newlib mailing list