]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed increment operators from postfix to prefix form.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 23 Jul 2012 15:15:27 +0000 (17:15 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 23 Jul 2012 15:15:27 +0000 (17:15 +0200)
23 files changed:
compat/xstring.cc
helpers/basic_auth/NCSA/crypt_md5.cc
helpers/basic_auth/PAM/basic_pam_auth.cc
helpers/basic_auth/RADIUS/basic_radius_auth.cc
helpers/basic_auth/SASL/basic_sasl_auth.cc
helpers/basic_auth/SMB/basic_smb_auth.cc
helpers/digest_auth/LDAP/ldap_backend.cc
helpers/digest_auth/eDirectory/ldap_backend.cc
helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc
helpers/external_acl/kerberos_ldap_group/support_ldap.cc
helpers/external_acl/unix_group/check_group.cc
helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc
lib/ntlmauth/ntlmauth.cc
src/DiskIO/DiskDaemon/DiskdFile.cc
src/acl/IntRange.cc
src/acl/RegexData.cc
src/auth/basic/UserRequest.cc
src/auth/digest/UserRequest.cc
src/auth/digest/auth_digest.cc
src/auth/negotiate/UserRequest.cc
src/base/TextException.cc
src/comm/ModSelectWin32.cc
src/esi/Esi.cc

index ed31d92e732aa2798de5b42ccb99f7bb8e1ef765..3a288780c79d2e99ad5af118df1d05509ee7a543 100644 (file)
@@ -40,7 +40,8 @@ xstrncpy(char *dst, const char *src, size_t n)
 
     if (src)
         while (--n != 0 && *src != '\0') {
-            *dst++ = *src;
+            *dst = *src;
+            ++dst;
             ++src;
         }
 
index 6b616d0b1b728466f9891967dcd62fbf267ee316..1890d4eda5eebfb6e71ca1dcd7fd688ce85e92b7 100644 (file)
@@ -32,7 +32,8 @@ static unsigned char itoa64[] =       /* 0 ... 63 => ascii - 64 */
 static void md5to64(char *s, unsigned long v, int n)
 {
     while (--n >= 0) {
-        *s++ = itoa64[v & 0x3f];
+        *s = itoa64[v & 0x3f];
+        ++s;
         v >>= 6;
     }
 }
index 8be058e8176936b4a70a838d303690428d476872..62d9a160cf180097fe33c6d1582eebb97fdeb0db 100644 (file)
@@ -221,7 +221,8 @@ start:
             debug("ERROR: %s: Unexpected input '%s'\n", argv[0], buf);
             goto error;
         }
-        *password_buf++ = '\0';
+        *password_buf = '\0';
+        ++password_buf;
         rfc1738_unescape(user);
         rfc1738_unescape(password_buf);
         conv.appdata_ptr = (char *) password_buf;      /* from buf above. not allocated */
index 21c0fec96e23906af719ccc86cb63794e3d6f601..a7cdde1adc3d3f0c8276b537a0d9c2b439160890 100644 (file)
@@ -269,7 +269,8 @@ urldecode(char *dst, const char *src, int size)
             ++src;
             tmp[1] = *src;
             ++src;
-            *dst++ = strtol(tmp, NULL, 16);
+            *dst = strtol(tmp, NULL, 16);
+            ++dst;
         } else {
             *dst = *src;
             ++dst;
@@ -312,12 +313,14 @@ authenticate(int socket_fd, const char *username, const char *passwd)
     /*
      *    User Name
      */
-    *ptr++ = PW_USER_NAME;
+    *ptr = PW_USER_NAME;
+    ++ptr;
     length = strlen(username);
     if (length > MAXPWNAM) {
         length = MAXPWNAM;
     }
-    *ptr++ = length + 2;
+    *ptr = length + 2;
+    ++ptr;
     memcpy(ptr, username, length);
     ptr += length;
     total_length += length + 2;
@@ -339,8 +342,10 @@ authenticate(int socket_fd, const char *username, const char *passwd)
      */
     length = ((length / AUTH_VECTOR_LEN) + 1) * AUTH_VECTOR_LEN;
 
-    *ptr++ = PW_PASSWORD;
-    *ptr++ = length + 2;
+    *ptr = PW_PASSWORD;
+    ++ptr;
+    *ptr = length + 2;
+    ++ptr;
 
     secretlen = strlen(secretkey);
     /* Set up the Cipher block chain */
@@ -353,21 +358,26 @@ authenticate(int socket_fd, const char *username, const char *passwd)
 
         /* Xor the password into the MD5 digest */
         for (i = 0; i < AUTH_VECTOR_LEN; ++i) {
-            *ptr++ = (cbc[i] ^= passbuf[j + i]);
+            *ptr = (cbc[i] ^= passbuf[j + i]);
+            ++ptr;
         }
     }
     total_length += length + 2;
 
-    *ptr++ = PW_NAS_PORT_ID;
-    *ptr++ = 6;
+    *ptr = PW_NAS_PORT_ID;
+    ++ptr;
+    *ptr = 6;
+    ++ptr;
 
     ui = htonl(nasport);
     memcpy(ptr, &ui, 4);
     ptr += 4;
     total_length += 6;
 
-    *ptr++ = PW_NAS_PORT_TYPE;
-    *ptr++ = 6;
+    *ptr = PW_NAS_PORT_TYPE;
+    ++ptr;
+    *ptr = 6;
+    ++ptr;
 
     ui = htonl(nasporttype);
     memcpy(ptr, &ui, 4);
@@ -376,14 +386,18 @@ authenticate(int socket_fd, const char *username, const char *passwd)
 
     if (*identifier) {
         int len = strlen(identifier);
-        *ptr++ = PW_NAS_ID;
-        *ptr++ = len + 2;
+        *ptr = PW_NAS_ID;
+        ++ptr;
+        *ptr = len + 2;
+        ++ptr;
         memcpy(ptr, identifier, len);
         ptr += len;
         total_length += len + 2;
     } else {
-        *ptr++ = PW_NAS_IP_ADDRESS;
-        *ptr++ = 6;
+        *ptr = PW_NAS_IP_ADDRESS;
+        ++ptr;
+        *ptr = 6;
+        ++ptr;
 
         ui = htonl(nas_ipaddr);
         memcpy(ptr, &ui, 4);
index bdff532a2fbb9d30d41edf91d51955a501b52d8c..eb50fadd98a7f3a59cdc8ee22dba89040d9a8921 100644 (file)
@@ -99,7 +99,8 @@ main(int argc, char *argv[])
             SEND_ERR("No Password");
             continue;
         }
-        *password++ = '\0';
+        *password = '\0';
+        ++password;
 
         rfc1738_unescape(username);
         rfc1738_unescape(password);
index f33442b23ad1f5611fca25c9b0a9ea60b797e818..9bea63a9888ca38a4690a9b4ba53651fdc35f2ab 100644 (file)
@@ -91,7 +91,8 @@ print_esc(FILE * p, char *s)
         if (*t == '\\')
             buf[i++] = '\\';
 
-        buf[i++] = *t;
+        buf[i] = *t;
+        ++i;
     }
 
     if (i > 0) {
index 3b9bf670e233c96697c6e1f4c32d002508a81c65..50e18f2931414868a1316237b4adab838553990d 100644 (file)
@@ -170,7 +170,8 @@ ldap_escape_value(char *escaped, int size, const char *src)
             n += 3;
             size -= 3;
             if (size > 0) {
-                *escaped++ = '\\';
+                *escaped = '\\';
+                ++escaped;
                 snprintf(escaped, 3, "%02x", (int) *src);
                 ++src;
                 escaped += 2;
index 39dbe9eefa767f7e336f353c9112aab4749e36c1..8f676e04547bdfc3cb2f131e8041dc2bcc4d6427 100644 (file)
@@ -171,7 +171,8 @@ ldap_escape_value(char *escaped, int size, const char *src)
             n += 3;
             size -= 3;
             if (size > 0) {
-                *escaped++ = '\\';
+                *escaped = '\\';
+                ++escaped;
                 snprintf(escaped, 3, "%02x", (int) *src);
                 ++src;
                 escaped += 2;
index 0a9fd534a3f1cd96e575cbd4ef7972c0e92849f2..03a74466e24ec649a9932ec59347d675c11698ff 100644 (file)
@@ -631,7 +631,8 @@ ldap_escape_value(char *escaped, int size, const char *src)
             n += 3;
             size -= 3;
             if (size > 0) {
-                *escaped++ = '\\';
+                *escaped = '\\';
+                ++escaped;
                 snprintf(escaped, 3, "%02x", (unsigned char) *src);
                 ++src;
                 escaped += 2;
index 9c79276cec2326517acfca5f03ee9d3964120370..070b0b9022b5fde147df22d9600ab9fef456b195 100644 (file)
@@ -243,8 +243,10 @@ convert_domain_to_bind_path(char *domain)
         if (*dp == '.') {
             strcpy(bp, ",dc=");
             bp += 4;
-        } else
-            *bp++ = *dp;
+        } else {
+            *bp = *dp;
+            ++bp;
+        }
     }
     *bp = '\0';
     return bindp;
index 9cf0150013753d3f319adc7c0e10fcac7a993882..0af0a0113c5a2cd20eb69427e71253a1a04dd24a 100644 (file)
@@ -169,7 +169,8 @@ main(int argc, char *argv[])
             break;
         case 'g':
             grents = (char**)realloc(grents, sizeof(*grents) * (ngroups+1));
-            grents[ngroups++] = optarg;
+            grents[ngroups] = optarg;
+            ++ngroups;
             break;
         case '?':
             if (xisprint(optopt)) {
index 9e82f47f279855cbb82d49bf947408741107fedb..4594557598f2825e25a04f9d0ee46503bcceae9d 100644 (file)
@@ -243,7 +243,8 @@ ntlm_check_auth(ntlm_authenticate * auth, int auth_length)
     }
     memcpy(domain, tmp.str, tmp.l);
     user = domain + tmp.l;
-    *user++ = '\0';
+    *user = '\0';
+    ++user;
 
     /*      debug("fetching user name\n"); */
     tmp = ntlm_fetch_string(&(auth->hdr), auth_length, &auth->user, auth->flags);
@@ -429,7 +430,8 @@ process_options(int argc, char *argv[])
             free(d);
             continue;
         }
-        *c++ = '\0';
+        *c= '\0';
+        ++c;
         new_dc = (dc *) malloc(sizeof(dc));
         if (!new_dc) {
             fprintf(stderr, "Malloc error while parsing DC options\n");
index def632c14af8d761e673c06352f51bb3dd109f78..5d991886c53cebc98faf73e5ed91fbce454804bb 100644 (file)
@@ -143,7 +143,8 @@ ntlm_fetch_string(const ntlmhdr *packet, const int32_t packet_size, const strhdr
                 fprintf(stderr, "ntlmssp: bad unicode: %04x\n", c);
                 return rv;
             }
-            *d++ = c;
+            *d = c;
+            ++d;
             ++rv.l;
         }
     } else {
index 9c56f723ace940ff6125f0815dc61e3a2e7caf3d..5946c8d0ab3eee884393c3f5bdd5ebf003b34b3c 100644 (file)
@@ -75,7 +75,8 @@ DiskdFile::DiskdFile(char const *aPath, DiskdIOStrategy *anIO) : errorOccured (f
     assert (aPath);
     debugs(79, 3, "DiskdFile::DiskdFile: " << aPath);
     path_ = xstrdup (aPath);
-    id = diskd_stats.sio_id++;
+    id = diskd_stats.sio_id;
+    ++diskd_stats.sio_id;
 }
 
 DiskdFile::~DiskdFile()
index a985fc70f02ff98608e0ce8654ef2fccf00b557d..186b1ce7a511b957a2081000beb66bd466d081c2 100644 (file)
@@ -53,8 +53,10 @@ ACLIntRange::parse()
         char *b = strchr(a, '-');
         unsigned short port1, port2;
 
-        if (b)
-            *b++ = '\0';
+        if (b) {
+            *b = '\0';
+            ++b;
+        }
 
         port1 = xatos(a);
 
index 34b99fb14ec3f0bf701cd1b713445c9b3a18943f..2a4a6d269e094c3c01a1c6f7224e33c3ae8b0a38 100644 (file)
@@ -235,12 +235,18 @@ compileOptimisedREs(relist **curlist, wordlist * wl)
             }
         } else if (RElen + largeREindex + 3 < BUFSIZ-1) {
             debugs(28, 2, "compileOptimisedREs: adding RE '" << wl->key << "'");
-            if (largeREindex > 0)
-                largeRE[largeREindex++] = '|';
-            largeRE[largeREindex++] = '(';
-            for (char * t = wl->key; *t != '\0'; ++t)
-                largeRE[largeREindex++] = *t;
-            largeRE[largeREindex++] = ')';
+            if (largeREindex > 0) {
+                largeRE[largeREindex] = '|';
+                ++largeREindex;
+            }
+            largeRE[largeREindex] = '(';
+            ++largeREindex;
+            for (char * t = wl->key; *t != '\0'; ++t) {
+                largeRE[largeREindex] = *t;
+                ++largeREindex;
+            }
+            largeRE[largeREindex] = ')';
+            ++largeREindex;
             largeRE[largeREindex] = '\0';
             ++numREs;
         } else {
index fc07a5d6ac76b706bbb08cfb29fa3d2272fdc256..490b2626bceece080b6ea6459615aa255480d0c4 100644 (file)
@@ -143,8 +143,10 @@ Auth::Basic::UserRequest::HandleReply(void *data, char *reply)
     debugs(29, 5, HERE << "{" << (reply ? reply : "<NULL>") << "}");
 
     if (reply) {
-        if ((t = strchr(reply, ' ')))
-            *t++ = '\0';
+        if ((t = strchr(reply, ' '))) {
+            *t = '\0';
+            ++t;
+        }
 
         if (*reply == '\0')
             reply = NULL;
index 92972fdf0ccf77d27c551db25e6a1bdf266a2e50..3305db575fc45dd6ef6ad5f94519d5bba602e9d3 100644 (file)
@@ -279,8 +279,10 @@ Auth::Digest::UserRequest::HandleReply(void *data, char *reply)
     debugs(29, 9, HERE << "{" << (reply ? reply : "<NULL>") << "}");
 
     if (reply) {
-        if ((t = strchr(reply, ' ')))
-            *t++ = '\0';
+        if ((t = strchr(reply, ' '))) {
+            *t = '\0';
+            ++t;
+        }
 
         if (*reply == '\0' || *reply == '\n')
             reply = NULL;
index 58ad620ae0ddf861fdc4df866712894bf085d197..4321778b64cacf59a5c8f2fe3b5f0ef29bde4fb4 100644 (file)
@@ -809,7 +809,8 @@ Auth::Digest::Config::decode(char const *proxy_auth)
         size_t nlen;
         size_t vlen;
         if ((p = (const char *)memchr(item, '=', ilen)) && (p - item < ilen)) {
-            nlen = p++ - item;
+            nlen = p - item;
+            ++p;
             vlen = ilen - (p - item);
         } else {
             nlen = ilen;
index 05489ba540aa7f2e6a5021929fa1ff1c84464fba..0722c705da132759441679d3c4384c5f8506442a 100644 (file)
@@ -278,8 +278,10 @@ Auth::Negotiate::UserRequest::HandleReply(void *data, void *lastserver, char *re
 
     if (strncasecmp(reply, "TT ", 3) == 0) {
         /* we have been given a blob to send to the client */
-        if (arg)
-            *arg++ = '\0';
+        if (arg) {
+            *arg = '\0';
+            ++arg;
+        }
         safe_free(lm_request->server_blob);
         lm_request->request->flags.must_keepalive = 1;
         if (lm_request->request->flags.proxy_keepalive) {
@@ -294,8 +296,10 @@ Auth::Negotiate::UserRequest::HandleReply(void *data, void *lastserver, char *re
     } else if (strncasecmp(reply, "AF ", 3) == 0 && arg != NULL) {
         /* we're finished, release the helper */
 
-        if (arg)
-            *arg++ = '\0';
+        if (arg) {
+            *arg = '\0';
+            ++arg;
+        }
 
         auth_user_request->user()->username(arg);
         auth_user_request->denyMessage("Login successful");
@@ -334,8 +338,10 @@ Auth::Negotiate::UserRequest::HandleReply(void *data, void *lastserver, char *re
     } else if (strncasecmp(reply, "NA ", 3) == 0 && arg != NULL) {
         /* authentication failure (wrong password, etc.) */
 
-        if (arg)
-            *arg++ = '\0';
+        if (arg) {
+            *arg = '\0';
+            ++arg;
+        }
 
         auth_user_request->denyMessage(arg);
         auth_user_request->user()->credentials(Auth::Failed);
index 60fd7304e81eeb54903be58b04aa2c78981a79e1..ef66a3793101c25d44db89e59233772a8717de6f 100644 (file)
@@ -57,7 +57,8 @@ unsigned int TextException::FileNameHash(const char *fname)
 
     while (*s) {
         ++j;
-        n ^= 271 * (unsigned) *s++;
+        n ^= 271 * (unsigned) *s;
+        ++s;
     }
     i = n ^ (j * 271);
     /*18bits of a 32 bit integer used  for filename hash (max hash=262143),
index f350c2fe6657d5f0d8fd65dbfd642df3f0946ad6..8d30690e88600a381d63421cb2408935e5c3f22a 100644 (file)
@@ -281,11 +281,15 @@ comm_select_udp_incoming(void)
     int nevents;
     udp_io_events = 0;
 
-    if (Comm::IsConnOpen(icpIncomingConn))
-        fds[nfds++] = icpIncomingConn->fd;
+    if (Comm::IsConnOpen(icpIncomingConn)) {
+        fds[nfds] = icpIncomingConn->fd;
+        ++nfds;
+    }
 
-    if (Comm::IsConnOpen(icpOutgoingConn) && icpIncomingConn != icpOutgoingConn)
-        fds[nfds++] = icpOutgoingConn->fd;
+    if (Comm::IsConnOpen(icpOutgoingConn) && icpIncomingConn != icpOutgoingConn) {
+        fds[nfds] = icpOutgoingConn->fd;
+        ++nfds;
+    }
 
     if (nfds == 0)
         return;
@@ -317,8 +321,10 @@ comm_select_tcp_incoming(void)
     // XXX: only poll sockets that won't be deferred. But how do we identify them?
 
     for (const AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
-        if (Comm::IsConnOpen(s->listenConn))
-            fds[nfds++] = s->listenConn->fd;
+        if (Comm::IsConnOpen(s->listenConn)) {
+            fds[nfds] = s->listenConn->fd;
+            ++nfds;
+        }
     }
 
     nevents = comm_check_incoming_select_handlers(nfds, fds);
@@ -657,11 +663,15 @@ comm_select_dns_incoming(void)
     if (DnsSocketA < 0 && DnsSocketB < 0)
         return;
 
-    if (DnsSocketA >= 0)
-        fds[nfds++] = DnsSocketA;
+    if (DnsSocketA >= 0) {
+        fds[nfds] = DnsSocketA;
+        ++nfds;
+    }
 
-    if (DnsSocketB >= 0)
-        fds[nfds++] = DnsSocketB;
+    if (DnsSocketB >= 0) {
+        fds[nfds] = DnsSocketB;
+        ++nfds;
+    }
 
     nevents = comm_check_incoming_select_handlers(nfds, fds);
 
index a52d1ea2ec15ac1ecdb6b37bdd812cd04e9b1cee..083e9a88ed9f2a24bbc3f0693754349ce92c59f0 100644 (file)
@@ -993,7 +993,8 @@ ESIContext::addStackElement (ESIElement::Pointer element)
         flags.error = 1;
     } else {
         /* added ok, push onto the stack */
-        parserState.stack[parserState.stackdepth++] = element;
+        parserState.stack[parserState.stackdepth] = element;
+        ++parserState.stackdepth;
     }
 }
 
@@ -1024,12 +1025,15 @@ ESIContext::start(const char *el, const char **attr, size_t attrCount)
         position = localbuf + strlen (localbuf);
 
         for (i = 0; i < specifiedattcount && attr[i]; i += 2) {
-            *position++ = ' ';
+            *position = ' ';
+            ++position;
             /* TODO: handle thisNode gracefully */
             assert (xstrncpy (position, attr[i], sizeof(localbuf) + (position - localbuf)));
             position += strlen (position);
-            *position++ = '=';
-            *position++ = '\"';
+            *position = '=';
+            ++position;
+            *position = '\"';
+            ++position;
             const char *chPtr = attr[i + 1];
             char ch;
             while ((ch = *chPtr++) != '\0') {
@@ -1042,7 +1046,8 @@ ESIContext::start(const char *el, const char **attr, size_t attrCount)
                 }
             }
             position += strlen (position);
-            *position++ = '\"';
+            *position = '\"';
+            ++position;
         }
 
         *position = '>';
@@ -1136,7 +1141,8 @@ ESIContext::end(const char *el)
         localbuf[1] = '/';
         assert (xstrncpy (&localbuf[2], el, sizeof(localbuf) - 3));
         position = localbuf + strlen (localbuf);
-        *position++ = '>';
+        *position = '>';
+        ++position;
         *position = '\0';
         addLiteral (localbuf, position - localbuf);
         break;
@@ -1285,7 +1291,8 @@ ESIContext::parse()
     if (!parserState.stackdepth) {
         debugs(86, 5, "empty parser stack, inserting the top level node");
         assert (tree.getRaw());
-        parserState.stack[parserState.stackdepth++] = tree;
+        parserState.stack[parserState.stackdepth] = tree;
+        ++parserState.stackdepth;
     }
 
     if (rep && !parserState.inited())