if (src)
while (--n != 0 && *src != '\0') {
- *dst++ = *src;
+ *dst = *src;
+ ++dst;
++src;
}
static void md5to64(char *s, unsigned long v, int n)
{
while (--n >= 0) {
- *s++ = itoa64[v & 0x3f];
+ *s = itoa64[v & 0x3f];
+ ++s;
v >>= 6;
}
}
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 */
++src;
tmp[1] = *src;
++src;
- *dst++ = strtol(tmp, NULL, 16);
+ *dst = strtol(tmp, NULL, 16);
+ ++dst;
} else {
*dst = *src;
++dst;
/*
* 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;
*/
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 */
/* 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);
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);
SEND_ERR("No Password");
continue;
}
- *password++ = '\0';
+ *password = '\0';
+ ++password;
rfc1738_unescape(username);
rfc1738_unescape(password);
if (*t == '\\')
buf[i++] = '\\';
- buf[i++] = *t;
+ buf[i] = *t;
+ ++i;
}
if (i > 0) {
n += 3;
size -= 3;
if (size > 0) {
- *escaped++ = '\\';
+ *escaped = '\\';
+ ++escaped;
snprintf(escaped, 3, "%02x", (int) *src);
++src;
escaped += 2;
n += 3;
size -= 3;
if (size > 0) {
- *escaped++ = '\\';
+ *escaped = '\\';
+ ++escaped;
snprintf(escaped, 3, "%02x", (int) *src);
++src;
escaped += 2;
n += 3;
size -= 3;
if (size > 0) {
- *escaped++ = '\\';
+ *escaped = '\\';
+ ++escaped;
snprintf(escaped, 3, "%02x", (unsigned char) *src);
++src;
escaped += 2;
if (*dp == '.') {
strcpy(bp, ",dc=");
bp += 4;
- } else
- *bp++ = *dp;
+ } else {
+ *bp = *dp;
+ ++bp;
+ }
}
*bp = '\0';
return bindp;
break;
case 'g':
grents = (char**)realloc(grents, sizeof(*grents) * (ngroups+1));
- grents[ngroups++] = optarg;
+ grents[ngroups] = optarg;
+ ++ngroups;
break;
case '?':
if (xisprint(optopt)) {
}
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);
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");
fprintf(stderr, "ntlmssp: bad unicode: %04x\n", c);
return rv;
}
- *d++ = c;
+ *d = c;
+ ++d;
++rv.l;
}
} else {
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()
char *b = strchr(a, '-');
unsigned short port1, port2;
- if (b)
- *b++ = '\0';
+ if (b) {
+ *b = '\0';
+ ++b;
+ }
port1 = xatos(a);
}
} 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 {
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;
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;
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;
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) {
} 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");
} 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);
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),
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;
// 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);
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);
flags.error = 1;
} else {
/* added ok, push onto the stack */
- parserState.stack[parserState.stackdepth++] = element;
+ parserState.stack[parserState.stackdepth] = element;
+ ++parserState.stackdepth;
}
}
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') {
}
}
position += strlen (position);
- *position++ = '\"';
+ *position = '\"';
+ ++position;
}
*position = '>';
localbuf[1] = '/';
assert (xstrncpy (&localbuf[2], el, sizeof(localbuf) - 3));
position = localbuf + strlen (localbuf);
- *position++ = '>';
+ *position = '>';
+ ++position;
*position = '\0';
addLiteral (localbuf, position - localbuf);
break;
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())