In examples/x11.c, Make sure sizeof passed to read operation is correct

sizeof(buf) expands to 8 or 4 (since its a pointer).  This variable may
have been static in the past, leading to this error.

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

View File

@ -217,7 +217,7 @@ static int x11_send_receive(LIBSSH2_CHANNEL *channel, int sock)
memset((void *)buf,0,bufsize);
/* Data in sock*/
rc = read(sock, buf,sizeof(buf));
rc = read(sock, buf, bufsize);
if (rc > 0)
rc = libssh2_channel_write(channel,buf, rc);
else