From 738d369fef9c690f2042b6dd20949dbd025844ba Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 23 Aug 2011 23:13:10 +1200 Subject: [PATCH] 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. --- helpers/negotiate_auth/wrapper/negotiate_wrapper.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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) -- 2.47.3