libventi: correct handling of VtRead size

Fixes #7 http://code.swtch.com/plan9port/issue/7/

Thanks to Venkatesh Srinivas and Michael Teichgräber
for finding the bug.

http://codereview.appspot.com/98041
This commit is contained in:
Russ Cox 2009-07-26 13:40:01 -04:00
parent 44c6e39c25
commit 6f4a41c68c

View file

@ -182,7 +182,7 @@ vtfcallunpack(VtFcall *f, Packet *p)
case 2: case 2:
if(packetconsume(p, buf, 2) < 0) if(packetconsume(p, buf, 2) < 0)
goto Err; goto Err;
f->count = (buf[2] << 8) | buf[3]; f->count = (buf[0] << 8) | buf[1];
break; break;
case 4: case 4:
if(packetconsume(p, buf, 4) < 0) if(packetconsume(p, buf, 4) < 0)