Fix compile error under Windows

This commit is contained in:
Antoine Pitrou 2011-05-12 02:07:00 +02:00
parent 3486a98dcd
commit 4e19e11958
1 changed files with 4 additions and 2 deletions

View File

@ -954,14 +954,16 @@ buffered_readinto(buffered *self, PyObject *args)
/* If remaining bytes is larger than internal buffer size, copy /* If remaining bytes is larger than internal buffer size, copy
* directly into caller's buffer. */ * directly into caller's buffer. */
if (remaining > self->buffer_size) { if (remaining > self->buffer_size) {
n = _bufferedreader_raw_read(self, buf.buf + written, remaining); n = _bufferedreader_raw_read(self, (char *) buf.buf + written,
remaining);
} }
else { else {
n = _bufferedreader_fill_buffer(self); n = _bufferedreader_fill_buffer(self);
if (n > 0) { if (n > 0) {
if (n > remaining) if (n > remaining)
n = remaining; n = remaining;
memcpy(buf.buf + written, self->buffer + self->pos, n); memcpy((char *) buf.buf + written,
self->buffer + self->pos, n);
self->pos += n; self->pos += n;
continue; /* short circuit */ continue; /* short circuit */
} }