windows: fix uninitialized local variable warning

Pass the user-returned buffer to the read calback. Fixes the following
warning:

    src\win\tcp.c(439): warning C4700: uninitialized local variable
    'buf'
This commit is contained in:
Ben Noordhuis 2013-08-09 19:00:50 +02:00
parent e4c1483b48
commit 85b92ad5bf

View File

@ -436,7 +436,7 @@ static void uv_tcp_queue_read(uv_loop_t* loop, uv_tcp_t* handle) {
handle->flags &= ~UV_HANDLE_ZERO_READ;
handle->read_buffer = handle->alloc_cb((uv_handle_t*) handle, 65536);
if (handle->read_buffer.len == 0) {
handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, buf);
handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, handle->read_buffer);
return;
}
assert(handle->read_buffer.base != NULL);