X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/087a9b2eaf10974c1b3025bf7d439c2371625e70..refs/heads/master:/lib/cgi.c diff --git a/lib/cgi.c b/lib/cgi.c index 15b556c..023c5bb 100644 --- a/lib/cgi.c +++ b/lib/cgi.c @@ -75,7 +75,7 @@ static void cgi__input(char **ptrp, size_t *np) { } if(memchr(q, 0, n)) disorder_fatal(0, "null character in request body"); - q[n + 1] = 0; + q[n] = 0; *ptrp = q; if(np) *np = n; @@ -226,7 +226,6 @@ void cgi_clear(void) { */ char *cgi_sgmlquote(const char *src) { uint32_t *ucs, c; - int n; struct dynstr d[1]; struct sink *s; @@ -234,7 +233,6 @@ char *cgi_sgmlquote(const char *src) { exit(1); dynstr_init(d); s = sink_dynstr(d); - n = 1; /* format the string */ while((c = *ucs++)) { switch(c) {