diff cli-agentfwd.c @ 1057:16584026a1f0 nocircbuffer

allocate buffer and data in a single allocation
author Matt Johnston <matt@ucc.asn.au>
date Sun, 01 Mar 2015 21:16:09 +0800
parents 9bf46570868f
children 750ec4ec4cbe
line wrap: on
line diff
--- a/cli-agentfwd.c	Sun Mar 01 14:46:04 2015 +0800
+++ b/cli-agentfwd.c	Sun Mar 01 21:16:09 2015 +0800
@@ -155,7 +155,7 @@
 		goto out;
 	}
 	
-	buf_resize(inbuf, readlen);
+	inbuf = buf_resize(inbuf, readlen);
 	buf_setpos(inbuf, 0);
 	ret = atomicio(read, fd, buf_getwriteptr(inbuf, readlen), readlen);
 	if ((size_t)ret != readlen) {