From: Amos Jeffries Date: Tue, 23 Aug 2011 11:13:10 +0000 (+1200) Subject: negotiate_wrapper_auth: fix warnings on MacOSX by simplification X-Git-Tag: take08~43^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=738d369fef9c690f2042b6dd20949dbd025844ba;p=thirdparty%2Fsquid.git negotiate_wrapper_auth: fix warnings on MacOSX by simplification * 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. --- diff --git a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc index 2b8bca2537..dbee8cfe50 100644 --- a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc +++ b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc @@ -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)