From: Francesco Chemolli Date: Mon, 2 Jul 2012 12:14:07 +0000 (+0200) Subject: Change increment and decrement operators from postfix to prefix form. X-Git-Tag: sourceformat-review-1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755494daccd0ba8b3f294f302c92a66b717f3e45;p=thirdparty%2Fsquid.git Change increment and decrement operators from postfix to prefix form. --- diff --git a/compat/strnstr.cc b/compat/strnstr.cc index f64cecdda6..598052b7d1 100644 --- a/compat/strnstr.cc +++ b/compat/strnstr.cc @@ -87,7 +87,7 @@ squid_strnstr(const char *s, const char *find, size_t slen) if (len > slen) return (NULL); } while (strncmp(s, find, len) != 0); - s--; + --s; } return s; } diff --git a/compat/xalloc.cc b/compat/xalloc.cc index a4eafa9dad..3f3a9ae13d 100644 --- a/compat/xalloc.cc +++ b/compat/xalloc.cc @@ -28,7 +28,7 @@ XMS_DBG_INDEX(int sz) static void stat_init(void) { - for (int i = 0; i <= XMS_DBG_MAXINDEX; i++) + for (int i = 0; i <= XMS_DBG_MAXINDEX; ++i) malloc_sizes[i] = malloc_histo[i] = 0; dbg_stat_init = 1; diff --git a/compat/xstrerror.cc b/compat/xstrerror.cc index 363efcaf55..0db14307cc 100644 --- a/compat/xstrerror.cc +++ b/compat/xstrerror.cc @@ -83,7 +83,7 @@ xstrerr(int error) #if _SQUID_WINDOWS_ // Description of WSAGetLastError() - for (size_t i = 0; i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); i++) { + for (size_t i = 0; i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); ++i) { if (_wsaerrtext[i].err == error) { // small optimization, save using a temporary buffer and two copies... snprintf(xstrerror_buf, BUFSIZ, "(%d) %s, %s", error, _wsaerrtext[i].errconst, _wsaerrtext[i].errdesc); diff --git a/helpers/basic_auth/LDAP/basic_ldap_auth.cc b/helpers/basic_auth/LDAP/basic_ldap_auth.cc index 04e40ab827..8e6f3c66f0 100644 --- a/helpers/basic_auth/LDAP/basic_ldap_auth.cc +++ b/helpers/basic_auth/LDAP/basic_ldap_auth.cc @@ -267,7 +267,7 @@ open_ldap_connection(const char *ldapServer, int port) sslpath); exit(1); } else { - sslinit++; + ++sslinit; } if ((ld = ldapssl_init(ldapServer, port, 1)) == NULL) { fprintf(stderr, "\nUnable to connect to SSL LDAP server: %s port:%d\n", @@ -332,7 +332,7 @@ validUsername(const char *user) if (p[0] != ' ') return 0; } - p++; + ++p; } /* Trailing whitespace? */ if (xisspace(p[0])) @@ -368,14 +368,14 @@ main(int argc, char **argv) value = argv[1] + 2; } else if (argc > 2) { value = argv[2]; - argv++; - argc--; + ++argv; + --argc; } else value = ""; break; } - argv++; - argc--; + ++argv; + --argc; switch (option) { case 'H': #if !HAS_URI_SUPPORT @@ -513,8 +513,8 @@ main(int argc, char **argv) } else { ldapServer = xstrdup(value); } - argc--; - argv++; + --argc; + ++argv; } if (!ldapServer) ldapServer = xstrdup("localhost"); @@ -630,8 +630,8 @@ ldap_escape_value(char *escaped, int size, const char *src) break; default: *escaped++ = *src++; - n++; - size--; + ++n; + --size; } } *escaped = '\0'; diff --git a/helpers/basic_auth/MSNT/confload.cc b/helpers/basic_auth/MSNT/confload.cc index cbb72d3e1e..4184a51cce 100644 --- a/helpers/basic_auth/MSNT/confload.cc +++ b/helpers/basic_auth/MSNT/confload.cc @@ -199,7 +199,7 @@ AddServer(char *ParamPDC, char *ParamBDC, char *ParamDomain) strncpy(ServerArray[Serversqueried].pdc, ParamPDC, NTHOSTLEN - 1); strncpy(ServerArray[Serversqueried].bdc, ParamBDC, NTHOSTLEN - 1); strncpy(ServerArray[Serversqueried].domain, ParamDomain, NTHOSTLEN - 1); - Serversqueried++; + ++Serversqueried; } /* @@ -212,7 +212,7 @@ int QueryServers(char *username, char *password) { int i; - for (i = 0; i < Serversqueried; i++) { + for (i = 0; i < Serversqueried; ++i) { if (0 == QueryServerForUser(i, username, password)) return 0; } diff --git a/helpers/basic_auth/MSNT/usersfile.cc b/helpers/basic_auth/MSNT/usersfile.cc index ef889e55c2..81e8e3661c 100644 --- a/helpers/basic_auth/MSNT/usersfile.cc +++ b/helpers/basic_auth/MSNT/usersfile.cc @@ -38,7 +38,7 @@ static void free_names(usersfile * uf) { int i; - for (i = 0; i < uf->Inuse; i++) { + for (i = 0; i < uf->Inuse; ++i) { if (uf->names[i]) free(uf->names[i]); uf->names[i] = NULL; @@ -115,7 +115,7 @@ Read_usersfile(const char *path, usersfile * uf) (uf->Alloc >> 1) * sizeof(*uf->names)); } uf->names[uf->Inuse] = xstrdup(buf); - uf->Inuse++; + ++uf->Inuse; } fclose(fp); fp = NULL; diff --git a/helpers/basic_auth/NCSA/crypt_md5.cc b/helpers/basic_auth/NCSA/crypt_md5.cc index abffb9ae6d..6874e9a05b 100644 --- a/helpers/basic_auth/NCSA/crypt_md5.cc +++ b/helpers/basic_auth/NCSA/crypt_md5.cc @@ -61,9 +61,9 @@ char *crypt_md5(const char *pw, const char *salt) if (*salt == '$') { magic = salt++; while (*salt && *salt != '$') - salt++; + ++salt; if (*salt == '$') { - salt++; + ++salt; magiclen = salt - magic; } else { salt = magic; @@ -75,7 +75,7 @@ char *crypt_md5(const char *pw, const char *salt) sp = salt; /* It stops at the first '$', max 8 chars */ - for (ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++) + for (ep = sp; *ep && *ep != '$' && ep < (sp + 8); ++ep) continue; /* get the length of the true salt */ @@ -124,7 +124,7 @@ char *crypt_md5(const char *pw, const char *salt) * On a 60 Mhz Pentium this takes 34 msec, so you would * need 30 seconds to build a 1000 entry dictionary... */ - for (i = 0; i < 1000; i++) { + for (i = 0; i < 1000; ++i) { SquidMD5Init(&ctx1); if (i & 1) SquidMD5Update(&ctx1, (unsigned const char *) pw, strlen(pw)); @@ -188,7 +188,7 @@ char *md5sum(const char *s) SquidMD5Update(&ctx,(const unsigned char *)s,strlen(s)); SquidMD5Final(digest,&ctx); - for (idx=0; idx<16; idx++) + for (idx=0; idx<16; ++idx) snprintf(&sum[idx*2],(33-(idx*2)),"%02x",digest[idx]); sum[32]='\0'; diff --git a/helpers/basic_auth/SMB/basic_smb_auth.cc b/helpers/basic_auth/SMB/basic_smb_auth.cc index 2e715112c0..f33442b23a 100644 --- a/helpers/basic_auth/SMB/basic_smb_auth.cc +++ b/helpers/basic_auth/SMB/basic_smb_auth.cc @@ -82,7 +82,7 @@ print_esc(FILE * p, char *s) char *t; int i = 0; - for (t = s; *t != '\0'; t++) { + for (t = s; *t != '\0'; ++t) { if (i > HELPER_INPUT_BUFFER-2) { buf[i] = '\0'; (void) fputs(buf, p); @@ -118,7 +118,7 @@ main(int argc, char *argv[]) return 1; /* parse command line arguments */ - for (i = 1; i < argc; i++) { + for (i = 1; i < argc; ++i) { if (strcmp(argv[i], "-d") == 0) { debug_enabled = 1; continue; @@ -178,13 +178,13 @@ main(int argc, char *argv[]) return 1; /* convert backslashes to forward slashes */ - for (s = lastdom->authshare; *s != '\0'; s++) + for (s = lastdom->authshare; *s != '\0'; ++s) if (*s == '\\') *s = '/'; /* strip leading forward slash from share name */ if (*lastdom->authshare == '/') - lastdom->authshare++; + ++lastdom->authshare; if ((s = strchr(lastdom->authshare, '/')) != NULL) { *s = '\0'; diff --git a/helpers/basic_auth/SSPI/valid.cc b/helpers/basic_auth/SSPI/valid.cc index 1a0f419ce1..f6db3f4730 100644 --- a/helpers/basic_auth/SSPI/valid.cc +++ b/helpers/basic_auth/SSPI/valid.cc @@ -93,7 +93,7 @@ Valid_Group(char *UserName, char *Group) */ if (nStatus == NERR_Success) { if ((pTmpBuf = pBuf) != NULL) { - for (i = 0; i < dwEntriesRead; i++) { + for (i = 0; i < dwEntriesRead; ++i) { if (pTmpBuf == NULL) { result = FALSE; break; @@ -102,8 +102,8 @@ Valid_Group(char *UserName, char *Group) result = TRUE; break; } - pTmpBuf++; - dwTotalCount++; + ++pTmpBuf; + ++dwTotalCount; } } } else @@ -136,7 +136,7 @@ Valid_User(char *UserName, char *Password, char *Group) errormsg = NTV_SERVER_ERROR_MSG; strncpy(NTDomain, UserName, sizeof(NTDomain)); - for (i=0; i < strlen(NTV_VALID_DOMAIN_SEPARATOR); i++) { + for (i=0; i < strlen(NTV_VALID_DOMAIN_SEPARATOR); ++i) { if ((domain_qualify = strchr(NTDomain, NTV_VALID_DOMAIN_SEPARATOR[i])) != NULL) break; } diff --git a/helpers/digest_auth/LDAP/ldap_backend.cc b/helpers/digest_auth/LDAP/ldap_backend.cc index 6efcaed9cb..aed8467241 100644 --- a/helpers/digest_auth/LDAP/ldap_backend.cc +++ b/helpers/digest_auth/LDAP/ldap_backend.cc @@ -177,8 +177,8 @@ ldap_escape_value(char *escaped, int size, const char *src) break; default: *escaped++ = *src++; - n++; - size--; + ++n; + --size; } } *escaped = '\0'; @@ -226,7 +226,7 @@ retrysrch: ldap_msgfree(res); /* try to connect to the LDAP server agin, maybe my persisten conexion failed. */ if (!retry) { - retry++; + ++retry; ldap_unbind(ld); ld = NULL; ldapconnect(); @@ -267,7 +267,7 @@ retrydnattr: password = *value; break; } - value++; + ++value; } debug("password: %s\n", password); if (password) @@ -279,7 +279,7 @@ retrydnattr: fprintf(stderr, PROGRAM_NAME " WARNING, LDAP error '%s'\n", ldap_err2string(rc)); /* try to connect to the LDAP server agin, maybe my persisten conexion failed. */ if (!retry) { - retry++; + ++retry; ldap_unbind(ld); ld = NULL; ldapconnect(); @@ -330,7 +330,7 @@ ldapconnect(void) sslpath); exit(1); } else { - sslinit++; + ++sslinit; } if ((ld = ldapssl_init(ldapServer, port, 1)) == NULL) { fprintf(stderr, "\nUnable to connect to SSL LDAP server: %s port:%d\n", @@ -408,14 +408,14 @@ LDAPArguments(int argc, char **argv) value = argv[1] + 2; } else if (argc > 2) { value = argv[2]; - argv++; - argc--; + ++argv; + --argc; } else value = ""; break; } - argv++; - argc--; + ++argv; + --argc; switch (option) { case 'H': #if !HAS_URI_SUPPORT @@ -559,8 +559,8 @@ LDAPArguments(int argc, char **argv) } else { ldapServer = xstrdup(value); } - argc--; - argv++; + --argc; + ++argv; } if (!ldapServer) diff --git a/helpers/digest_auth/eDirectory/edir_ldapext.cc b/helpers/digest_auth/eDirectory/edir_ldapext.cc index 49d896eeb0..a13b718757 100644 --- a/helpers/digest_auth/eDirectory/edir_ldapext.cc +++ b/helpers/digest_auth/eDirectory/edir_ldapext.cc @@ -181,7 +181,7 @@ static int berEncodeLoginData( err = (ber_printf(requestBer, "{i{", methodIDLen) < 0) ? LDAP_ENCODING_ERROR : 0; } - for (i = 0; !err && i < elemCnt; i++) { + for (i = 0; !err && i < elemCnt; ++i) { err = (ber_printf(requestBer, "i", methodID[i]) < 0) ? LDAP_ENCODING_ERROR : 0; } diff --git a/helpers/digest_auth/eDirectory/ldap_backend.cc b/helpers/digest_auth/eDirectory/ldap_backend.cc index 0a40403c9a..1ed4622564 100644 --- a/helpers/digest_auth/eDirectory/ldap_backend.cc +++ b/helpers/digest_auth/eDirectory/ldap_backend.cc @@ -178,8 +178,8 @@ ldap_escape_value(char *escaped, int size, const char *src) break; default: *escaped++ = *src++; - n++; - size--; + ++n; + --size; } } *escaped = '\0'; @@ -230,7 +230,7 @@ retrysrch: ldap_msgfree(res); /* try to connect to the LDAP server agin, maybe my persisten conexion failed. */ if (!retry) { - retry++; + ++retry; ldap_unbind(ld); ld = NULL; ldapconnect(); @@ -290,7 +290,7 @@ retrydnattr: password = *value; break; } - value++; + ++value; } debug("password: %s\n", password); if (password) @@ -307,7 +307,7 @@ retrydnattr: fprintf(stderr, PROGRAM_NAME " WARNING, LDAP error '%s'\n", ldap_err2string(rc)); /* try to connect to the LDAP server agin, maybe my persisten conexion failed. */ if (!retry) { - retry++; + ++retry; ldap_unbind(ld); ld = NULL; ldapconnect(); @@ -358,7 +358,7 @@ ldapconnect(void) sslpath); exit(1); } else { - sslinit++; + ++sslinit; } if ((ld = ldapssl_init(ldapServer, port, 1)) == NULL) { fprintf(stderr, "\nUnable to connect to SSL LDAP server: %s port:%d\n", @@ -436,14 +436,14 @@ LDAPArguments(int argc, char **argv) value = argv[1] + 2; } else if (argc > 2) { value = argv[2]; - argv++; - argc--; + ++argv; + --argc; } else value = ""; break; } - argv++; - argc--; + ++argv; + --argc; switch (option) { case 'H': #if !HAS_URI_SUPPORT @@ -590,8 +590,8 @@ LDAPArguments(int argc, char **argv) } else { ldapServer = xstrdup(value); } - argc--; - argv++; + --argc; + ++argv; } if (!ldapServer) diff --git a/helpers/external_acl/AD_group/ext_ad_group_acl.cc b/helpers/external_acl/AD_group/ext_ad_group_acl.cc index 62c8a0b2a5..2c84bd771e 100644 --- a/helpers/external_acl/AD_group/ext_ad_group_acl.cc +++ b/helpers/external_acl/AD_group/ext_ad_group_acl.cc @@ -358,19 +358,19 @@ add_User_Group(wchar_t * Group) if (User_Groups_Count == 0) { User_Groups = (wchar_t **) xmalloc(sizeof(wchar_t *)); *User_Groups = NULL; - User_Groups_Count++; + ++User_Groups_Count; } array = User_Groups; while (*array) { if (wcscmp(Group, *array) == 0) return 0; - array++; + ++array; } User_Groups = (wchar_t **) xrealloc(User_Groups, sizeof(wchar_t *) * (User_Groups_Count + 1)); User_Groups[User_Groups_Count] = NULL; User_Groups[User_Groups_Count - 1] = (wchar_t *) xmalloc((wcslen(Group) + 1) * sizeof(wchar_t)); wcscpy(User_Groups[User_Groups_Count - 1], Group); - User_Groups_Count++; + ++User_Groups_Count; return 1; } @@ -384,7 +384,7 @@ wccmparray(const wchar_t * str, const wchar_t ** array) debug("Windows group: %S, Squid group: %S\n", str, *array); if (wcscmp(str, *array) == 0) return 0; - array++; + ++array; } return -1; } @@ -402,7 +402,7 @@ wcstrcmparray(const wchar_t * str, const char **array) debug("Windows group: %S, Squid group: %S\n", str, wszGroup); if ((use_case_insensitive_compare ? _wcsicmp(str, wszGroup) : wcscmp(str, wszGroup)) == 0) return 0; - array++; + ++array; } return -1; } @@ -519,12 +519,12 @@ build_groups_DN_array(const char **array, char *userdomain) MultiByteToWideChar(CP_ACP, 0, Group, -1, wc, wcsize); *entry = My_NameTranslate(wc, source_group_format, ADS_NAME_TYPE_1779); safe_free(wc); - array++; + ++array; if (*entry == NULL) { debug("build_groups_DN_array: cannot get DN for '%s'.\n", Group); continue; } - entry++; + ++entry; } *entry = NULL; return wc_array; @@ -593,8 +593,8 @@ Valid_Local_Groups(char *UserName, const char **Groups) result = 1; break; } - pTmpBuf++; - dwTotalCount++; + ++pTmpBuf; + ++dwTotalCount; } } } else { @@ -705,7 +705,7 @@ Valid_Global_Groups(char *UserName, const char **Groups) result = 1; break; } - tmp++; + ++tmp; } } else debug("Valid_Global_Groups: ADsGetObject for %S failed, ERROR: %s\n", User_LDAP_path, Get_WIN32_ErrorMessage(hr)); @@ -716,14 +716,14 @@ Valid_Global_Groups(char *UserName, const char **Groups) tmp = wszGroups; while (*tmp) { safe_free(*tmp); - tmp++; + ++tmp; } safe_free(wszGroups); tmp = User_Groups; while (*tmp) { safe_free(*tmp); - tmp++; + ++tmp; } safe_free(User_Groups); User_Groups_Count = 0; diff --git a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc index 2a1a778ff0..af03d8fcbc 100644 --- a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc +++ b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc @@ -251,14 +251,14 @@ main(int argc, char **argv) value = argv[1] + 2; } else if (argc > 2) { value = argv[2]; - argv++; - argc--; + ++argv; + --argc; } else value = ""; break; } - argv++; - argc--; + ++argv; + --argc; switch (option) { case 'H': #if !HAS_URI_SUPPORT @@ -405,8 +405,8 @@ main(int argc, char **argv) } else { ldapServer = xstrdup(value); } - argc--; - argv++; + --argc; + ++argv; } if (!ldapServer) @@ -528,7 +528,7 @@ recover: fprintf(stderr, "FATAL: Unable to initialise SSL with cert path %s\n", sslpath); exit(1); } else { - sslinit++; + ++sslinit; } if ((ld = ldapssl_init(ldapServer, port, 1)) == NULL) { fprintf(stderr, "FATAL: Unable to connect to SSL LDAP server: %s port:%d\n", @@ -638,8 +638,8 @@ ldap_escape_value(char *escaped, int size, const char *src) break; default: *escaped++ = *src++; - n++; - size--; + ++n; + --size; } } *escaped = '\0'; @@ -653,18 +653,18 @@ build_filter(char *filter, int size, const char *templ, const char *user, const while (*templ && size > 0) { switch (*templ) { case '%': - templ++; + ++templ; switch (*templ) { case 'u': case 'v': - templ++; + ++templ; n = ldap_escape_value(filter, size, user); size -= n; filter += n; break; case 'g': case 'a': - templ++; + ++templ; n = ldap_escape_value(filter, size, group); size -= n; filter += n; @@ -676,15 +676,15 @@ build_filter(char *filter, int size, const char *templ, const char *user, const } break; case '\\': - templ++; + ++templ; if (*templ) { *filter++ = *templ++; - size--; + --size; } break; default: *filter++ = *templ++; - size--; + --size; break; } } diff --git a/helpers/external_acl/LM_group/ext_lm_group_acl.cc b/helpers/external_acl/LM_group/ext_lm_group_acl.cc index 5755dbcc5e..a93390917e 100644 --- a/helpers/external_acl/LM_group/ext_lm_group_acl.cc +++ b/helpers/external_acl/LM_group/ext_lm_group_acl.cc @@ -229,7 +229,7 @@ wcstrcmparray(const wchar_t * str, const char **array) debug("Windows group: %S, Squid group: %S\n", str, wszGroup); if ((use_case_insensitive_compare ? _wcsicmp(str, wszGroup) : wcscmp(str, wszGroup)) == 0) return 0; - array++; + ++array; } return -1; } @@ -295,8 +295,8 @@ Valid_Local_Groups(char *UserName, const char **Groups) result = 1; break; } - pTmpBuf++; - dwTotalCount++; + ++pTmpBuf; + ++dwTotalCount; } } } else @@ -432,8 +432,8 @@ Valid_Global_Groups(char *UserName, const char **Groups) result = 1; break; } - pTmpBuf++; - dwTotalCount++; + ++pTmpBuf; + ++dwTotalCount; } } } else { diff --git a/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc b/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc index 1777e9ff3e..7a6781c589 100644 --- a/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc +++ b/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc @@ -237,7 +237,7 @@ local_printfx(const char *msg,...) va_end(ap); if (x > 0) { dbuf[x] = '\0'; - x++; + ++x; fputs(dbuf, stdout); *(dbuf) = '\0'; } else { @@ -267,7 +267,7 @@ StringSplit(char *In_Str, char chr, char *Out_Str, size_t Out_Sz) // find the char delimiter position... char *p = In_Str; while (*p != chr && *p != '\0' && (In_Str+In_Len) > p) { - p++; + ++p; } size_t i = (p-In_Str); @@ -283,8 +283,8 @@ StringSplit(char *In_Str, char chr, char *Out_Str, size_t Out_Sz) // omit the delimiter if (*p == chr) { - p++; - i++; + ++p; + ++i; } else { // chr not found (or \0 found first). Wipe whole input buffer. memset(In_Str, 0, In_Len); @@ -320,7 +320,7 @@ BinarySplit(void *In_Obj, size_t In_Sz, char chr, void *Out_Obj, size_t Out_Sz) // find the char delimiter position... char *p = static_cast(In_Obj); while (*p != chr && (in+In_Sz) > p) { - p++; + ++p; } size_t i = (p-in); @@ -336,8 +336,8 @@ BinarySplit(void *In_Obj, size_t In_Sz, char chr, void *Out_Obj, size_t Out_Sz) // omit the delimiter if (*p == chr) { - p++; - i++; + ++p; + ++i; } else { // chr not found memset(In_Obj, 0, In_Sz); @@ -853,13 +853,13 @@ ConvertIP(edui_ldap_t *l, char *ip) /* bufa starts with a ::, so just copy and clear */ xstrncpy(bufb, bufa, sizeof(bufb)); *(bufa) = '\0'; - swi++; /* Indicates that there is a bufb */ + ++swi; /* Indicates that there is a bufb */ } else if ((bufa[0] == ':') && (bufa[1] != ':')) { /* bufa starts with a :, a typo so just fill in a ':', cat and clear */ bufb[0] = ':'; strncat(bufb, bufa, strlen(bufa)); *(bufa) = '\0'; - swi++; /* Indicates that there is a bufb */ + ++swi; /* Indicates that there is a bufb */ } else { p = strstr(bufa, "::"); if (p != NULL) { @@ -869,7 +869,7 @@ ConvertIP(edui_ldap_t *l, char *ip) memcpy(bufb, p, i); *p = '\0'; bufb[i] = '\0'; - swi++; /* Indicates that there is a bufb */ + ++swi; /* Indicates that there is a bufb */ } } } @@ -973,21 +973,21 @@ ConvertIP(edui_ldap_t *l, char *ip) t = strlen(bufb); /* How many ':' exist in bufb ? */ j = 0; - for (i = 0; i < t; i++) { + for (i = 0; i < t; ++i) { if (bufb[i] == ':') - j++; + ++j; } - j--; /* Preceeding "::" doesn't count */ + --j; /* Preceeding "::" doesn't count */ t = 8 - (strlen(l->search_ip) / 4) - j; /* Remainder */ if (t > 0) { - for (i = 0; i < t; i++) + for (i = 0; i < t; ++i) strncat(l->search_ip, "0000", 4); } } } if ((bufa[0] == '\0') && (swi > 0)) { s = strlen(bufb); - swi++; + ++swi; } else s = strlen(bufa); } @@ -1095,14 +1095,14 @@ SearchFilterLDAP(edui_ldap_t *l, char *group) for (i = 0; i < s; i++) { if (swi == 2) { bufc[j] = '\134'; - j++; + ++j; bufc[j] = l->search_ip[i]; - j++; + ++j; swi = 1; } else { bufc[j] = l->search_ip[i]; - j++; - swi++; + ++j; + ++swi; } } if (group == NULL) { @@ -1570,7 +1570,7 @@ MainSafe(int argc, char **argv) edui_conf.mode |= EDUI_MODE_PERSIST; /* Don't set mode more than once */ break; case 'v': - i++; /* Set LDAP version */ + ++i; /* Set LDAP version */ if (argv[i] != NULL) { edui_conf.ver = atoi(argv[i]); if (edui_conf.ver < 1) @@ -1584,7 +1584,7 @@ MainSafe(int argc, char **argv) } break; case 't': - i++; /* Set Persistent timeout */ + ++i; /* Set Persistent timeout */ if (argv[i] != NULL) { edui_conf.persist_timeout = atoi(argv[i]); if (edui_conf.persist_timeout < 0) @@ -1596,7 +1596,7 @@ MainSafe(int argc, char **argv) } break; case 'b': - i++; /* Set Base DN */ + ++i; /* Set Base DN */ if (argv[i] != NULL) xstrncpy(edui_conf.basedn, argv[i], sizeof(edui_conf.basedn)); else { @@ -1606,7 +1606,7 @@ MainSafe(int argc, char **argv) } break; case 'H': - i++; /* Set Hostname */ + ++i; /* Set Hostname */ if (argv[i] != NULL) xstrncpy(edui_conf.host, argv[i], sizeof(edui_conf.host)); else { @@ -1616,7 +1616,7 @@ MainSafe(int argc, char **argv) } break; case 'p': - i++; /* Set port */ + ++i; /* Set port */ if (argv[i] != NULL) edui_conf.port = atoi(argv[i]); else { @@ -1626,7 +1626,7 @@ MainSafe(int argc, char **argv) } break; case 'D': - i++; /* Set Bind DN */ + ++i; /* Set Bind DN */ if (argv[i] != NULL) xstrncpy(edui_conf.dn, argv[i], sizeof(edui_conf.dn)); else { @@ -1636,7 +1636,7 @@ MainSafe(int argc, char **argv) } break; case 'W': - i++; /* Set Bind PWD */ + ++i; /* Set Bind PWD */ if (argv[i] != NULL) xstrncpy(edui_conf.passwd, argv[i], sizeof(edui_conf.passwd)); else { @@ -1646,7 +1646,7 @@ MainSafe(int argc, char **argv) } break; case 'F': - i++; /* Set Search Filter */ + ++i; /* Set Search Filter */ if (argv[i] != NULL) xstrncpy(edui_conf.search_filter, argv[i], sizeof(edui_conf.search_filter)); else { @@ -1660,7 +1660,7 @@ MainSafe(int argc, char **argv) edui_conf.mode |= EDUI_MODE_GROUP; /* Don't set mode more than once */ break; case 's': - i++; /* Set Scope Level */ + ++i; /* Set Scope Level */ if (argv[i] != NULL) { if (!strncmp(argv[i], "base", 4)) edui_conf.scope = 0; @@ -1677,7 +1677,7 @@ MainSafe(int argc, char **argv) } break; case 'u': - i++; /* Set Search Attribute */ + ++i; /* Set Search Attribute */ if (argv[i] != NULL) { xstrncpy(edui_conf.attrib, argv[i], sizeof(edui_conf.attrib)); } else { diff --git a/helpers/external_acl/file_userip/ext_file_userip_acl.cc b/helpers/external_acl/file_userip/ext_file_userip_acl.cc index 8aa7f22bb7..c06fc6bd05 100644 --- a/helpers/external_acl/file_userip/ext_file_userip_acl.cc +++ b/helpers/external_acl/file_userip/ext_file_userip_acl.cc @@ -182,7 +182,7 @@ int match_group(char *dict_group, char *username) { struct group *g; /* a struct to hold group entries */ - dict_group++; /* the @ should be the first char + ++dict_group; /* the @ should be the first char so we rip it off by incrementing * the pointer by one */ diff --git a/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc b/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc index 634d6ecad7..68773fe654 100644 --- a/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc +++ b/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc @@ -385,7 +385,7 @@ main(int argc, char *const argv[]) if (nuser || nuser8) { if (nuser) { *nuser = '\0'; - nuser++; + ++nuser; } else { *nuser8 = '\0'; nuser = nuser8 + 3; @@ -400,7 +400,7 @@ main(int argc, char *const argv[]) } else if (domain) { strup(domain); *domain = '\0'; - domain++; + ++domain; } if (!domain && margs.ddomain) { domain = xstrdup(margs.ddomain); @@ -435,7 +435,7 @@ strup(char *s) { while (*s) { *s = toupper((unsigned char) *s); - s++; + ++s; } } diff --git a/helpers/external_acl/kerberos_ldap_group/support_group.cc b/helpers/external_acl/kerberos_ldap_group/support_group.cc index 17779b6814..4b3abae847 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_group.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_group.cc @@ -57,7 +57,7 @@ utf8dup(struct main_args *margs) return NULL; for (n = 0; n < strlen(src); n++) if ((unsigned char) src[n] > 127) - c++; + ++c; if (c != 0) { p = (unsigned char *) xmalloc(strlen(src) + c); dupp = p; @@ -65,15 +65,15 @@ utf8dup(struct main_args *margs) s = (unsigned char) src[n]; if (s > 127 && s < 192) { *p = 194; - p++; + ++p; *p = s; } else if (s > 191 && s < 256) { *p = 195; - p++; + ++p; *p = s - 64; } else *p = s; - p++; + ++p; } *p = '\0'; debug((char *) "%s| %s: INFO: Group %s as UTF-8: %s\n", LogTime(), PROGRAM, src, dupp); @@ -134,8 +134,8 @@ hex_utf_char(struct main_args *margs, int flag) break; if (up[n] == '@') { ul[nl] = '@'; - nl++; - n++; + ++nl; + ++n; continue; } ival = up[n]; @@ -159,7 +159,7 @@ hex_utf_char(struct main_args *margs, int flag) xfree(ul); return NULL; } - n++; + ++n; ival = up[n]; if (ival > 64 && ival < 71) ichar = ichar + ival - 55; @@ -184,7 +184,7 @@ hex_utf_char(struct main_args *margs, int flag) } else if (iUTF2 > 0xC3 && iUTF2 < 0xE0 && ichar > 0x7F && ichar < 0xC0) { iUTF2 = 0; ul[nl] = ichar; - nl++; + ++nl; } else { iUTF2 = 0; ul[nl] = ichar; @@ -198,23 +198,23 @@ hex_utf_char(struct main_args *margs, int flag) if (iUTF3 == 0xE0 && ichar > 0x9F && ichar < 0xC0) { iUTF3 = 1; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF3 > 0xE0 && iUTF3 < 0xED && ichar > 0x7F && ichar < 0xC0) { iUTF3 = 2; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF3 == 0xED && ichar > 0x7F && ichar < 0xA0) { iUTF3 = 3; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF3 > 0xED && iUTF3 < 0xF0 && ichar > 0x7F && ichar < 0xC0) { iUTF3 = 4; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF3 > 0 && iUTF3 < 5 && ichar > 0x7F && ichar < 0xC0) { iUTF3 = 0; ul[nl] = ichar; - nl++; + ++nl; } else { iUTF3 = 0; ul[nl] = ichar; @@ -228,22 +228,22 @@ hex_utf_char(struct main_args *margs, int flag) if (iUTF4 == 0xF0 && ichar > 0x8F && ichar < 0xC0) { iUTF4 = 1; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF4 > 0xF0 && iUTF3 < 0xF4 && ichar > 0x7F && ichar < 0xC0) { iUTF4 = 2; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF4 == 0xF4 && ichar > 0x7F && ichar < 0x90) { iUTF4 = 3; ul[nl] = ichar; - nl++; + ++nl; } else if (iUTF4 > 0 && iUTF4 < 5 && ichar > 0x7F && ichar < 0xC0) { if (iUTF4 == 4) iUTF4 = 0; else iUTF4 = 4; ul[nl] = ichar; - nl++; + ++nl; } else { iUTF4 = 0; ul[nl] = ichar; @@ -256,22 +256,22 @@ hex_utf_char(struct main_args *margs, int flag) } else if (ichar < 0x80) { /* UTF1 */ ul[nl] = ichar; - nl++; + ++nl; } else if (ichar > 0xC1 && ichar < 0xE0) { /* UTF2 (Latin) */ iUTF2 = ichar; ul[nl] = ichar; - nl++; + ++nl; } else if (ichar > 0xDF && ichar < 0xF0) { /* UTF3 */ iUTF3 = ichar; ul[nl] = ichar; - nl++; + ++nl; } else if (ichar > 0xEF && ichar < 0xF5) { /* UTF4 */ iUTF4 = ichar; ul[nl] = ichar; - nl++; + ++nl; } else { ul[nl] = ichar; ul[nl + 1] = '\0'; @@ -280,7 +280,7 @@ hex_utf_char(struct main_args *margs, int flag) xfree(ul); return NULL; } - n++; + ++n; } ul[nl] = '\0'; @@ -373,7 +373,7 @@ create_gd(struct main_args *margs) } while (*p) { /* loop over group list */ if (*p == '\n' || *p == '\r') { /* Ignore CR and LF if exist */ - p++; + ++p; continue; } if (*p == '@') { /* end of group name - start of domain name */ @@ -382,7 +382,7 @@ create_gd(struct main_args *margs) return (1); } *p = '\0'; - p++; + ++p; gdsp = init_gd(); gdsp->group = gp; if (gdspn) /* Have already an existing structure */ @@ -394,7 +394,7 @@ create_gd(struct main_args *margs) return (1); } *p = '\0'; - p++; + ++p; if (dp) { /* end of domain name */ gdsp->domain = xstrdup(dp); dp = NULL; @@ -408,7 +408,7 @@ create_gd(struct main_args *margs) gp = p; /* after : starts new group name */ debug((char *) "%s| %s: INFO: Group %s Domain %s\n", LogTime(), PROGRAM, gdsp->group, gdsp->domain ? gdsp->domain : "NULL"); } else - p++; + ++p; } if (p == gp) { /* empty group name not allowed */ debug((char *) "%s| %s: ERROR: No group defined for domain %s\n", LogTime(), PROGRAM, p); diff --git a/helpers/external_acl/kerberos_ldap_group/support_krb5.cc b/helpers/external_acl/kerberos_ldap_group/support_krb5.cc index f5ae7ea0d0..44a6b95aac 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_krb5.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_krb5.cc @@ -92,7 +92,7 @@ krb5_create_cache(struct main_args *margs, char *domain) krb5_kt_default_name(kparam.context, buf, KT_PATH_MAX); p = strchr(buf, ':'); /* Find the end if "FILE:" */ if (p) - p++; /* step past : */ + ++p; /* step past : */ keytab_name = xstrdup(p ? p : buf); debug((char *) "%s| %s: DEBUG: Got default keytab file name %s\n", LogTime(), PROGRAM, keytab_name); diff --git a/helpers/external_acl/kerberos_ldap_group/support_ldap.cc b/helpers/external_acl/kerberos_ldap_group/support_ldap.cc index 594b8559f0..e0b83b024e 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_ldap.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_ldap.cc @@ -229,7 +229,7 @@ convert_domain_to_bind_path(char *domain) for (dp = domain; *dp; dp++) { if (*dp == '.') - i++; + ++i; } /* * add dc= and @@ -282,7 +282,7 @@ escape_filter(char *filter) ldf = ldf + 3; } else { *ldf = *filter; - ldf++; + ++ldf; } } *ldf = '\0'; @@ -933,7 +933,7 @@ get_memberof(struct main_args *margs, char *user, char *domain, char *group) port = 389; if ((p = strchr(host, ':'))) { *p = '\0'; - p++; + ++p; port = atoi(p); } nhosts = get_hostname_list(margs, &hlist, 0, host); diff --git a/helpers/external_acl/kerberos_ldap_group/support_lserver.cc b/helpers/external_acl/kerberos_ldap_group/support_lserver.cc index c855c865e3..16bb243d2e 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_lserver.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_lserver.cc @@ -67,7 +67,7 @@ create_ls(struct main_args *margs) } while (*p) { /* loop over group list */ if (*p == '\n' || *p == '\r') { /* Ignore CR and LF if exist */ - p++; + ++p; continue; } if (*p == '@') { /* end of group name - start of domain name */ @@ -76,7 +76,7 @@ create_ls(struct main_args *margs) return (1); } *p = '\0'; - p++; + ++p; lssp = init_ls(); lssp->lserver = xstrdup(np); if (lsspn) /* Have already an existing structure */ @@ -88,7 +88,7 @@ create_ls(struct main_args *margs) return (1); } *p = '\0'; - p++; + ++p; if (dp) { /* end of domain name */ lssp->domain = xstrdup(dp); dp = NULL; @@ -102,7 +102,7 @@ create_ls(struct main_args *margs) np = p; /* after : starts new group name */ debug((char *) "%s| %s: DEBUG: ldap server %s Domain %s\n", LogTime(), PROGRAM, lssp->lserver, lssp->domain?lssp->domain:"NULL"); } else - p++; + ++p; } if (p == np) { /* empty group name not allowed */ debug((char *) "%s| %s: DEBUG: No ldap servers defined for domain %s\n", LogTime(), PROGRAM, p); diff --git a/helpers/external_acl/kerberos_ldap_group/support_member.cc b/helpers/external_acl/kerberos_ldap_group/support_member.cc index a8af1ee7b4..d9916821b0 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_member.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_member.cc @@ -62,7 +62,7 @@ check_memberof(struct main_args *margs, char *user, char *domain) debug((char *) "%s| %s: INFO: User %s is member of group@domain %s@%s\n", LogTime(), PROGRAM, user, gr->group, gr->domain); else log((char *) "%s| %s: INFO: User %s is member of group@domain %s@%s\n", LogTime(), PROGRAM, user, gr->group, gr->domain); - found++; + ++found; break; } else { if (debug_enabled) @@ -90,7 +90,7 @@ check_memberof(struct main_args *margs, char *user, char *domain) debug((char *) "%s| %s: INFO: User %s is member of group@domain %s@%s\n", LogTime(), PROGRAM, user, gr->group, gr->domain); else log((char *) "%s| %s: INFO: User %s is member of group@domain %s@%s\n", LogTime(), PROGRAM, user, gr->group, gr->domain); - found++; + ++found; break; } else { if (debug_enabled) @@ -118,7 +118,7 @@ check_memberof(struct main_args *margs, char *user, char *domain) debug((char *) "%s| %s: INFO: User %s is member of group@domain %s@%s\n", LogTime(), PROGRAM, user, gr->group, gr->domain ? gr->domain : "NULL"); else log((char *) "%s| %s: INFO: User %s is member of group@domain %s@%s\n", LogTime(), PROGRAM, user, gr->group, gr->domain ? gr->domain : "NULL"); - found++; + ++found; break; } else { if (debug_enabled) diff --git a/helpers/external_acl/kerberos_ldap_group/support_netbios.cc b/helpers/external_acl/kerberos_ldap_group/support_netbios.cc index 0b608fb81c..a721385578 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_netbios.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_netbios.cc @@ -68,7 +68,7 @@ create_nd(struct main_args *margs) } while (*p) { /* loop over group list */ if (*p == '\n' || *p == '\r') { /* Ignore CR and LF if exist */ - p++; + ++p; continue; } if (*p == '@') { /* end of group name - start of domain name */ @@ -77,7 +77,7 @@ create_nd(struct main_args *margs) return (1); } *p = '\0'; - p++; + ++p; ndsp = init_nd(); ndsp->netbios = xstrdup(np); if (ndspn) /* Have already an existing structure */ @@ -89,7 +89,7 @@ create_nd(struct main_args *margs) return (1); } *p = '\0'; - p++; + ++p; if (dp) { /* end of domain name */ ndsp->domain = xstrdup(dp); dp = NULL; @@ -107,7 +107,7 @@ create_nd(struct main_args *margs) } debug((char *) "%s| %s: DEBUG: Netbios name %s Domain %s\n", LogTime(), PROGRAM, ndsp->netbios, ndsp->domain); } else - p++; + ++p; } if (p == np) { /* empty group name not allowed */ debug((char *) "%s| %s: DEBUG: No netbios name defined for domain %s\n", LogTime(), PROGRAM, p); diff --git a/helpers/external_acl/kerberos_ldap_group/support_resolv.cc b/helpers/external_acl/kerberos_ldap_group/support_resolv.cc index bbe19509a8..1ad03dbfa1 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_resolv.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_resolv.cc @@ -189,7 +189,7 @@ get_hostname_list(struct main_args *margs, struct hstruct **hlist, int nhosts, c hres_list = hres; count = 0; while (hres_list) { - count++; + ++count; hres_list = hres_list->ai_next; } hres_list = hres; @@ -202,7 +202,7 @@ get_hostname_list(struct main_args *margs, struct hstruct **hlist, int nhosts, c *hlist = hp; return (nhosts); } - count++; + ++count; debug((char *) "%s| %s: DEBUG: Resolved address %d of %s to %s\n", LogTime(), PROGRAM, count, name, host); hp = (struct hstruct *) xrealloc(hp, sizeof(struct hstruct) * (nhosts + 1)); @@ -210,7 +210,7 @@ get_hostname_list(struct main_args *margs, struct hstruct **hlist, int nhosts, c hp[nhosts].port = -1; hp[nhosts].priority = -1; hp[nhosts].weight = -1; - nhosts++; + ++nhosts; hres_list = hres_list->ai_next; } @@ -251,7 +251,7 @@ get_ldap_hostname_list(struct main_args *margs, struct hstruct **hlist, int nh, hp[nhosts].port = -1; hp[nhosts].priority = -2; hp[nhosts].weight = -2; - nhosts++; + ++nhosts; } else if ( !ls->domain || !strcasecmp(ls->domain, "") ) { debug((char *) "%s| %s: DEBUG: Found lserver@domain %s@%s\n", LogTime(), PROGRAM, ls->lserver, ls->domain?ls->domain:"NULL"); hp = (struct hstruct *) xrealloc(hp, sizeof(struct hstruct) * (nhosts + 1)); @@ -259,7 +259,7 @@ get_ldap_hostname_list(struct main_args *margs, struct hstruct **hlist, int nh, hp[nhosts].port = -1; hp[nhosts].priority = -2; hp[nhosts].weight = -2; - nhosts++; + ++nhosts; } ls = ls->next; @@ -381,7 +381,7 @@ get_ldap_hostname_list(struct main_args *margs, struct hstruct **hlist, int nh, hp[nh].port = port; hp[nh].priority = priority; hp[nh].weight = weight; - nh++; + ++nh; p += size; } else { p += rdlength; @@ -410,24 +410,24 @@ cleanup: hp[nhosts].port = -1; hp[nhosts].priority = -2; hp[nhosts].weight = -2; - nhosts++; + ++nhosts; /* Remove duplicates */ - for (i = 0; i < nhosts; i++) { - for (j = i + 1; j < nhosts; j++) { + for (i = 0; i < nhosts; ++i) { + for (j = i + 1; j < nhosts; ++j) { if (!strcasecmp(hp[i].host, hp[j].host)) { if (hp[i].port == hp[j].port || (hp[i].port == -1 && hp[j].port == 389) || (hp[i].port == 389 && hp[j].port == -1)) { xfree(hp[j].host); - for (k = j + 1; k < nhosts; k++) { + for (k = j + 1; k < nhosts; ++k) { hp[k - 1].host = hp[k].host; hp[k - 1].port = hp[k].port; hp[k - 1].priority = hp[k].priority; hp[k - 1].weight = hp[k].weight; } - j--; - nhosts--; + --j; + --nhosts; hp = (struct hstruct *) xrealloc(hp, sizeof(struct hstruct) * (nhosts + 1)); } } @@ -439,7 +439,7 @@ cleanup: if (debug_enabled) { debug((char *) "%s| %s: DEBUG: Sorted ldap server names for domain %s:\n", LogTime(), PROGRAM, domain); - for (i = 0; i < nhosts; i++) { + for (i = 0; i < nhosts; ++i) { debug((char *) "%s| %s: DEBUG: Host: %s Port: %d Priority: %d Weight: %d\n", LogTime(), PROGRAM, hp[i].host, hp[i].port, hp[i].priority, hp[i].weight); } } diff --git a/helpers/external_acl/kerberos_ldap_group/support_sasl.cc b/helpers/external_acl/kerberos_ldap_group/support_sasl.cc index d6f37f02e0..eadd152883 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_sasl.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_sasl.cc @@ -187,7 +187,7 @@ lutil_sasl_interact( if (rc) return rc; - interact++; + ++interact; } return LDAP_SUCCESS; diff --git a/helpers/log_daemon/file/log_file_daemon.cc b/helpers/log_daemon/file/log_file_daemon.cc index ee4c7c0008..234d4d80b0 100644 --- a/helpers/log_daemon/file/log_file_daemon.cc +++ b/helpers/log_daemon/file/log_file_daemon.cc @@ -53,7 +53,7 @@ rotate(const char *path, int rotate_count) #endif /* Rotate numbers 0 through N up one */ for (i = rotate_count; i > 1;) { - i--; + --i; snprintf(from, MAXPATHLEN, "%s.%d", path, i - 1); snprintf(to, MAXPATHLEN, "%s.%d", path, i); #if _SQUID_OS2_ || _SQUID_WINDOWS_ diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc index e383387412..c578a92928 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc @@ -135,7 +135,7 @@ gethost_name(void) hres_list = hres; count = 0; while (hres_list) { - count++; + ++count; hres_list = hres_list->ai_next; } rc = getnameinfo(hres->ai_addr, hres->ai_addrlen, hostname, diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc index 4660bdc850..898a38e6ed 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc @@ -227,7 +227,7 @@ main(int argc, char *argv[]) while (count > 0) { Token = (const char *) squid_kerb_proxy_auth(argv[1]); fprintf(stdout, "YR %s\n", Token ? Token : "NULL"); - count--; + --count; } fprintf(stdout, "QQ\n"); } else { diff --git a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc index 0300edc56e..2276f33c7b 100644 --- a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc +++ b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc @@ -137,7 +137,7 @@ main(int argc, char *const argv[]) j = 2; } - for (i=j; i= 3 && (!strncmp(tbuff,"AF ",3) || !strncmp(tbuff,"NA ",3))) { strncpy(buff,tbuff,3); buff[3]='='; - for (unsigned int i=2; i<=strlen(tbuff); i++) + for (unsigned int i=2; i<=strlen(tbuff); ++i) buff[i+2] = tbuff[i]; } else { strcpy(buff,tbuff); diff --git a/helpers/ntlm_auth/SSPI/ntlm_sspi_auth.cc b/helpers/ntlm_auth/SSPI/ntlm_sspi_auth.cc index 5f209ca2f6..53e01ea6c1 100644 --- a/helpers/ntlm_auth/SSPI/ntlm_sspi_auth.cc +++ b/helpers/ntlm_auth/SSPI/ntlm_sspi_auth.cc @@ -140,7 +140,7 @@ Valid_Group(char *UserName, char *Group) */ if (nStatus == NERR_Success) { if ((pTmpBuf = pBuf) != NULL) { - for (i = 0; i < dwEntriesRead; i++) { + for (i = 0; i < dwEntriesRead; ++i) { if (pTmpBuf == NULL) { result = FALSE; break; @@ -149,8 +149,8 @@ Valid_Group(char *UserName, char *Group) result = TRUE; break; } - pTmpBuf++; - dwTotalCount++; + ++pTmpBuf; + ++dwTotalCount; } } } else diff --git a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc index 981600e0e3..9e82f47f27 100644 --- a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc +++ b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc @@ -411,7 +411,7 @@ process_options(int argc, char *argv[]) exit(1); /* Okay, now begin filling controllers up */ /* we can avoid memcpy-ing, and just reuse argv[] */ - for (j = optind; j < argc; j++) { + for (j = optind; j < argc; ++j) { char *d, *c; /* d will not be freed in case of non-error. Since we don't reconfigure, * it's going to live as long as the process anyways */ @@ -439,7 +439,7 @@ process_options(int argc, char *argv[]) /* capitalize */ uc(c); uc(d); - numcontrollers++; + ++numcontrollers; new_dc->domain = d; new_dc->controller = c; new_dc->dead = 0; @@ -468,7 +468,7 @@ obtain_challenge() { int j = 0; const char *ch = NULL; - for (j = 0; j < numcontrollers; j++) { + for (j = 0; j < numcontrollers; ++j) { debug("obtain_challenge: selecting %s\\%s (attempt #%d)\n", current_dc->domain, current_dc->controller, j + 1); if (current_dc->dead != 0) { @@ -698,7 +698,7 @@ main(int argc, char *argv[]) debug("load balancing. Selected controller #%d\n", n); while (n > 0) { current_dc = current_dc->next; - n--; + --n; } } while (1) {