diff options
Diffstat (limited to 'src/lib9p')
-rw-r--r-- | src/lib9p/srv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib9p/srv.c b/src/lib9p/srv.c index ec02c81f..c0b18db6 100644 --- a/src/lib9p/srv.c +++ b/src/lib9p/srv.c @@ -64,7 +64,7 @@ getreq(Srv *s) return nil; } - buf = emalloc9p(n); + buf = emalloc9p(n+1); /* +1 for NUL in swrite */ memmove(buf, s->rbuf, n); qunlock(&s->rlock); @@ -535,9 +535,10 @@ swrite(Srv *srv, Req *r) respond(r, e); return; } - if(srv->write) + if(srv->write){ + r->ifcall.data[r->ifcall.count] = 0; /* enough room - see getreq */ srv->write(r); - else + }else respond(r, "no srv->write"); } static void |