chiark / gitweb /
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/disorder
[disorder] / lib / cgi.c
index 15b556c483cbc51915c179ee1b72e6e23ccafc4c..023c5bb988cd24968f8ba2bbb76633723e2ef66d 100644 (file)
--- 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) {