From: Automatic source maintenance Date: Sun, 7 Mar 2010 02:50:26 +0000 (-0700) Subject: SourceFormat Enforcement X-Git-Tag: SQUID_3_1_0_18~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b01667409528720f94a8d7469653edbbb4e8469d;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index 6cc35be113..8f5a35c684 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -342,15 +342,15 @@ httpHeaderParseQuotedString (const char *start, String *val) pos = start + 1; while (*pos != '"') { - bool quoted = (*pos == '\\'); - if (quoted) - pos++; + bool quoted = (*pos == '\\'); + if (quoted) + pos++; if (!*pos) { debugs(66, 2, "failed to parse a quoted-string header field near '" << start << "'"); val->clean(); return 0; } - end = pos + strcspn(pos + quoted, "\"\\") + quoted; + end = pos + strcspn(pos + quoted, "\"\\") + quoted; val->append(pos, end-pos); pos = end; } diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index 2e33f07940..c8285bdeea 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -1127,27 +1127,27 @@ AuthDigestConfig::decode(char const *proxy_auth) while (strListGetItem(&temp, ',', &item, &ilen, &pos)) { /* isolate directive name & value */ size_t nlen; - size_t vlen; + size_t vlen; if ((p = (const char *)memchr(item, '=', ilen)) && (p - item < ilen)) { nlen = p++ - item; - vlen = ilen - (p - item); + vlen = ilen - (p - item); } else { nlen = ilen; - vlen = 0; - } + vlen = 0; + } - /* parse value. auth-param = token "=" ( token | quoted-string ) */ + /* parse value. auth-param = token "=" ( token | quoted-string ) */ String value; - if (vlen > 0) { - if (*p == '"') { - if (!httpHeaderParseQuotedString(p, &value)) { - debugs(29, 9, "authDigestDecodeAuth: Failed to parse attribute '" << temp << "' in '" << proxy_auth << "'"); - continue; - } - } else { - value.limitInit(p, vlen); - } - } else { + if (vlen > 0) { + if (*p == '"') { + if (!httpHeaderParseQuotedString(p, &value)) { + debugs(29, 9, "authDigestDecodeAuth: Failed to parse attribute '" << temp << "' in '" << proxy_auth << "'"); + continue; + } + } else { + value.limitInit(p, vlen); + } + } else { debugs(29, 9, "authDigestDecodeAuth: Failed to parse attribute '" << temp << "' in '" << proxy_auth << "'"); continue; }