]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Change increment and decrement operators from postfix to prefix form.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 2 Jul 2012 12:14:07 +0000 (14:14 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 2 Jul 2012 12:14:07 +0000 (14:14 +0200)
32 files changed:
compat/strnstr.cc
compat/xalloc.cc
compat/xstrerror.cc
helpers/basic_auth/LDAP/basic_ldap_auth.cc
helpers/basic_auth/MSNT/confload.cc
helpers/basic_auth/MSNT/usersfile.cc
helpers/basic_auth/NCSA/crypt_md5.cc
helpers/basic_auth/SMB/basic_smb_auth.cc
helpers/basic_auth/SSPI/valid.cc
helpers/digest_auth/LDAP/ldap_backend.cc
helpers/digest_auth/eDirectory/edir_ldapext.cc
helpers/digest_auth/eDirectory/ldap_backend.cc
helpers/external_acl/AD_group/ext_ad_group_acl.cc
helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc
helpers/external_acl/LM_group/ext_lm_group_acl.cc
helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc
helpers/external_acl/file_userip/ext_file_userip_acl.cc
helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc
helpers/external_acl/kerberos_ldap_group/support_group.cc
helpers/external_acl/kerberos_ldap_group/support_krb5.cc
helpers/external_acl/kerberos_ldap_group/support_ldap.cc
helpers/external_acl/kerberos_ldap_group/support_lserver.cc
helpers/external_acl/kerberos_ldap_group/support_member.cc
helpers/external_acl/kerberos_ldap_group/support_netbios.cc
helpers/external_acl/kerberos_ldap_group/support_resolv.cc
helpers/external_acl/kerberos_ldap_group/support_sasl.cc
helpers/log_daemon/file/log_file_daemon.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc
helpers/negotiate_auth/wrapper/negotiate_wrapper.cc
helpers/ntlm_auth/SSPI/ntlm_sspi_auth.cc
helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc

index f64cecdda61b46b3b30a052350884ffebc0113ea..598052b7d157aca6f115b61e9c1e7b0853dccfde 100644 (file)
@@ -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;
 }
index a4eafa9dad98aae0d4c9ae6a2b30e422e4feee21..3f3a9ae13dd7fdba5e3b1fb0ee1c50e0e7998857 100644 (file)
@@ -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;
index 363efcaf55020979847fc2e719b2562e82783b82..0db14307cce18a23fb8b8de71c7dddd493c83b16 100644 (file)
@@ -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);
index 04e40ab827337dd3721da4c3b72841554eeac5bc..8e6f3c66f02eb60b58f4de99427dd29d3bd37aa4 100644 (file)
@@ -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';
index cbb72d3e1e276e43518591c5c889818a01530226..4184a51cce4dc3c6364bdb3aecbf79b41a57ee89 100644 (file)
@@ -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;
     }
index ef889e55c29132ca91547db73a3047b3bd2cf6a4..81e8e3661cd513d490305d23d29192c0e612f54f 100644 (file)
@@ -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;
index abffb9ae6dc9e9a4777cde699a9edf4bf4b3fb10..6874e9a05b1b5db3a2407d045493b8a7fb2f56c9 100644 (file)
@@ -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';
index 2e715112c0717a9aa7c3c48b17c0190ba6aa12df..f33442b23ad1f5611fca25c9b0a9ea60b797e818 100644 (file)
@@ -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';
index 1a0f419ce1d924a917c3b6a3f2b05671ca7c6327..f6db3f47303b186ac92d78e84b87f98653883c73 100644 (file)
@@ -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;
     }
index 6efcaed9cb63f11095a85b2978e8e8d3d3669ea6..aed84672414eb1f81a763ef8f8540b57821419ec 100644 (file)
@@ -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)
index 49d896eeb031aa422b1f773f407ff962033b9eb1..a13b71875707dbf42b352685368af9271e6d9fb1 100644 (file)
@@ -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;
     }
 
index 0a40403c9a2804b33f791443b2e3b4a66960a9ad..1ed4622564a6197f7fbe1aa7c0abae0109c2eb77 100644 (file)
@@ -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)
index 62c8a0b2a59a4b96131645fa6849a3b9340e4a53..2c84bd771e7ff4ca52a54a1d3e087364b3eeee26 100644 (file)
@@ -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;
index 2a1a778ff0b032ea688dbf2787686971d5ebe10a..af03d8fcbc2180a8c144ca5f7b9c0a30df493435 100644 (file)
@@ -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;
         }
     }
index 5755dbcc5e2aab47a55c5db06c72a6ec75ae4983..a93390917e3fada490e2881ca65394c72a03d1c3 100644 (file)
@@ -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 {
index 1777e9ff3ee15d28072b73d7260d9bb8a8ce550a..7a6781c58926e83b5165d6e3cbbc6e4bdcfff4e4 100644 (file)
@@ -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<char*>(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 {
index 8aa7f22bb7a603056af3de074821aad0a369d4d3..c06fc6bd05d8567d5a9b57b48b2cbb3f20288d8d 100644 (file)
@@ -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 */
 
index 634d6ecad7f259faf030e91ee456de39c6484dff..68773fe6549cf122c5ccce84a6c34bd84d0f9aef 100644 (file)
@@ -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;
     }
 }
 
index 17779b68143c67d88f62b92d30e9a856762277f9..4b3abae847f32cd279ada23f58ae30c794f22a07 100644 (file)
@@ -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);
index f5ae7ea0d0d8e8e7e48a6a0120f885c5766d43b3..44a6b95aac3a575542f66a01251c1de333970592 100644 (file)
@@ -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);
 
index 594b8559f0bf200c2d3f34de33b4892f4bfd4bbc..e0b83b024e530004ab34c6e1d2ff3d4d7a623c0b 100644 (file)
@@ -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);
index c855c865e3635fa22548d29ae57f9af5ed71ee45..16bb243d2ec566b54d30739ba5797fe04dc2bd7a 100644 (file)
@@ -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);
index a8af1ee7b4087538d2611d858cbb420f5d6aec83..d9916821b07924ad3a549c9a1c1acb9d81b8140f 100644 (file)
@@ -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)
index 0b608fb81c57e1f28664d61aa40bb386024f8753..a7213855788e973e94c1063bc6311d0c79bbf0bd 100644 (file)
@@ -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);
index bbe19509a8988741a615db00c38c2215e1528a9a..1ad03dbfa13d479fd384ca0b5a0ecba4e0e1f2c1 100644 (file)
@@ -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);
         }
     }
index d6f37f02e093d0608f21a6ab98c2be64b7c187f7..eadd152883b10e34d9884a56a748b7b0a7e5017c 100644 (file)
@@ -187,7 +187,7 @@ lutil_sasl_interact(
 
         if (rc)
             return rc;
-        interact++;
+        ++interact;
     }
 
     return LDAP_SUCCESS;
index ee4c7c0008d44abf7bbbe12fb5a906a56c52d6c7..234d4d80b0ffa4f29e556afa0941a1a2fafa5b2a 100644 (file)
@@ -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_
index e383387412554fa0ad53b2aa1351ee8089200f01..c578a9292871e8f433eb7442433c33aa9d099642 100644 (file)
@@ -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,
index 4660bdc850bafa8b55a829d394b627df7cc0f832..898a38e6ed17230706f49caa5e690ce5ae0c1d95 100644 (file)
@@ -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 {
index 0300edc56ee98830c96d7b2a5f8d355f9d3671d9..2276f33c7bf2cb0d183244a544659d52ac9a289b 100644 (file)
@@ -137,7 +137,7 @@ main(int argc, char *const argv[])
         j = 2;
     }
 
-    for (i=j; i<argc; i++) {
+    for (i=j; i<argc; ++i) {
         if (!strncasecmp(argv[i],"--ntlm",6))
             nstart = i;
         if (!strncasecmp(argv[i],"--kerberos",10))
@@ -167,7 +167,7 @@ main(int argc, char *const argv[])
     nargs[nend-nstart]=NULL;
     if (debug) {
         fprintf(stderr, "%s| %s: NTLM command: ", LogTime(), PROGRAM);
-        for (i=0; i<nend-nstart; i++)
+        for (i=0; i<nend-nstart; ++i)
             fprintf(stderr, "%s ", nargs[i]);
         fprintf(stderr, "\n");
     }
@@ -179,7 +179,7 @@ main(int argc, char *const argv[])
     kargs[kend-kstart]=NULL;
     if (debug) {
         fprintf(stderr, "%s| %s: Kerberos command: ", LogTime(), PROGRAM);
-        for (i=0; i<kend-kstart; i++)
+        for (i=0; i<kend-kstart; ++i)
             fprintf(stderr, "%s ", kargs[i]);
         fprintf(stderr, "\n");
     }
@@ -381,7 +381,7 @@ main(int argc, char *const argv[])
             if (strlen(tbuff) >= 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);
index 5f209ca2f6b68c39034583607e1913b80e55081d..53e01ea6c1de2c0ac3c4568c27632d7540235041 100644 (file)
@@ -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
index 981600e0e3bf6872ab77d6a6a2a5b3b3f4d48bdb..9e82f47f279855cbb82d49bf947408741107fedb 100644 (file)
@@ -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) {