Fix suspicious sizeof usage in examples/x11.c

In the x11 example, sizeof(buf) = 8UL (on x86_64), when this should
probably represent the buffer size available.  I am not sure how to
test that this change is actually correct, however.

Signed-off-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Steven Dake 2012-03-12 07:09:09 +01:00 committed by Daniel Stenberg
parent bf097e37b0
commit 626f91da07

View File

@ -208,7 +208,7 @@ static int x11_send_receive(LIBSSH2_CHANNEL *channel, int sock)
rc = libssh2_poll(fds, nfds, 0);
if (rc >0) {
rc = libssh2_channel_read(channel, buf,sizeof(buf));
rc = libssh2_channel_read(channel, buf, bufsize);
rc = write(sock, buf, rc);
}