put NUL in right place!

This commit is contained in:
rsc 2006-02-14 19:45:01 +00:00
parent 0df4c01eca
commit 943cb39dd9

View file

@ -64,7 +64,7 @@ getreq(Srv *s)
return nil; return nil;
} }
buf = emalloc9p(n); buf = emalloc9p(n+1); /* +1 for NUL in swrite */
memmove(buf, s->rbuf, n); memmove(buf, s->rbuf, n);
qunlock(&s->rlock); qunlock(&s->rlock);
@ -535,9 +535,10 @@ swrite(Srv *srv, Req *r)
respond(r, e); respond(r, e);
return; return;
} }
if(srv->write) if(srv->write){
r->ifcall.data[r->ifcall.count] = 0; /* enough room - see getreq */
srv->write(r); srv->write(r);
else }else
respond(r, "no srv->write"); respond(r, "no srv->write");
} }
static void static void