]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
const cleanup
authorhno <>
Mon, 22 Apr 2002 04:14:08 +0000 (04:14 +0000)
committerhno <>
Mon, 22 Apr 2002 04:14:08 +0000 (04:14 +0000)
src/gopher.cc

index 9f14ab1f664bdffdec57fa23e87b29f5a696e571..55505bb64f638469b78589e217a7ecb326409cd4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.163 2002/04/21 21:23:15 hno Exp $
+ * $Id: gopher.cc,v 1.164 2002/04/21 22:14:08 hno Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -743,16 +743,16 @@ gopherSendRequest(int fd, void *data)
 {
     GopherStateData *gopherState = data;
     char *buf = memAllocate(MEM_4K_BUF);
-    char *t;
     if (gopherState->type_id == GOPHER_CSO) {
-       t = strchr(gopherState->request, '?');
-       if (t)
-           t++;
+       const char *t = strchr(gopherState->request, '?');
+       if (t != NULL)
+           t++; /* skip the ? */
        else
            t = "";
        snprintf(buf, 4096, "query %s\r\nquit\r\n", t);
     } else if (gopherState->type_id == GOPHER_INDEX) {
-       if ((t = strchr(gopherState->request, '?')))
+       char *t = strchr(gopherState->request, '?');
+       if (t != NULL)
            *t = '\t';
        snprintf(buf, 4096, "%s\r\n", gopherState->request);
     } else {