diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-02-25 03:21:09 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-02-25 03:21:09 +0100 |
commit | e1dcd2beb412a3e77b5c6df23571135137b486ed (patch) | |
tree | 8b6f27dfe5b80778f34611f02c23a44e967f5802 /sys/src/cmd/webfs/http.c | |
parent | 05227960c6fd55dc8b050bf83e71f0924bfaf257 (diff) |
webfs: properly handle %.*s in url path and debug prints
Diffstat (limited to 'sys/src/cmd/webfs/http.c')
-rw-r--r-- | sys/src/cmd/webfs/http.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c index c279aeafe..907035bcc 100644 --- a/sys/src/cmd/webfs/http.c +++ b/sys/src/cmd/webfs/http.c @@ -663,7 +663,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost) for(;;){ if(n >= sizeof(buf)-2){ if(debug) - fprint(2, "-> %.*s", n, buf); + fprint(2, "-> %.*s", utfnlen(buf, n), buf); if(hwrite(h, buf, n) != n) goto Badflush; n = 0; @@ -685,7 +685,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost) continue; if(n > 0){ if(debug) - fprint(2, "-> %.*s", n, buf); + fprint(2, "-> %.*s", utfnlen(buf, n), buf); if(hwrite(h, buf, n) != n) goto Badflush; } @@ -693,7 +693,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost) } n += snprint(buf+n, sizeof(buf)-n, "\r\n"); if(debug) - fprint(2, "-> %.*s", n, buf); + fprint(2, "-> %.*s", utfnlen(buf, n), buf); if(hwrite(h, buf, n) != n){ Badflush: alarm(0); |