]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
negotiate_wrapper_auth: fix warnings on MacOSX by simplification
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 23 Aug 2011 11:13:10 +0000 (23:13 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 23 Aug 2011 11:13:10 +0000 (23:13 +1200)
 * fold several if statements down to avoid compiler warnings
   about potential use-before-set of 'length'.

 * remove static err variable as unused once its cases are
   folded down to one if statement.

helpers/negotiate_auth/wrapper/negotiate_wrapper.cc

index 2b8bca25375d0d2746e7ce3db20ef22297bf4d59..dbee8cfe50b1d38e88c4fc95212c2247545b8a61 100644 (file)
@@ -108,7 +108,6 @@ main(int argc, char *const argv[])
     char tbuff[MAX_AUTHTOKEN_LEN];
     char buff[MAX_AUTHTOKEN_LEN+2];
     char *c;
-    static int err = 0;
     int debug = 0;
     int length;
     int nstart = 0, kstart = 0;
@@ -299,20 +298,16 @@ main(int argc, char *const argv[])
         if (c) {
             *c = '\0';
             length = c - buf;
+            if (debug)
+                fprintf(stderr, "%s| %s: Got '%s' from squid (length: %d).\n",
+                        LogTime(), PROGRAM, buf, length);
         } else {
-            err = 1;
-        }
-        if (err) {
             if (debug)
                 fprintf(stderr, "%s| %s: Oversized message\n", LogTime(),
                         PROGRAM);
             fprintf(stdout, "BH Oversized message\n");
-            err = 0;
             continue;
         }
-        if (debug)
-            fprintf(stderr, "%s| %s: Got '%s' from squid (length: %d).\n",
-                    LogTime(), PROGRAM, buf, length);
 
         if (buf[0] == '\0') {
             if (debug)