From a46ef85a56080f30c9516bd6012b8ebb3098a41a Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Mon, 12 Mar 2012 07:10:58 +0100 Subject: [PATCH] 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 --- example/x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/x11.c b/example/x11.c index 085b7bea..6480dc8d 100644 --- a/example/x11.c +++ b/example/x11.c @@ -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