while (strListGetItem(&str, ',', &item, &ilen, &pos)) {
/* isolate directive name */
- if ((p = (const char *)memchr(item, '=', ilen)) && (p - item < ilen))
- nlen = p++ - item;
- else
+ if ((p = (const char *)memchr(item, '=', ilen)) && (p - item < ilen)) {
+ nlen = p - item;
+ ++p;
+ } else {
nlen = ilen;
+ }
/* find type */
const CcNameToIdMap_t::const_iterator i=CcNameToIdMap.find(StringArea(item,nlen));
}
/* decrease ilen to still match the token for ';' qualified non '=' statments */
- else if ((p = strchr(item, ';')) && (p - item < ilen))
- ilen = p++ - item;
+ else if ((p = strchr(item, ';')) && (p - item < ilen)) {
+ ilen = p - item;
+ ++p;
+ }
/* find type */
/* TODO: use a type-safe map-based lookup */
if (Config.onoff.relaxed_header_parser) {
char *p = (char *) this_line; /* XXX Warning! This destroys original header content and violates specifications somewhat */
- while ((p = (char *)memchr(p, '\r', field_end - p)) != NULL)
- *p++ = ' ';
+ while ((p = (char *)memchr(p, '\r', field_end - p)) != NULL) {
+ *p = ' ';
+ ++p;
+ }
} else
goto reset;
}
int i;
int64_t ms = -1;
- for (i = 0; i < Config.cacheSwap.n_configured; i++) {
+ for (i = 0; i < Config.cacheSwap.n_configured; ++i) {
assert (Config.cacheSwap.swapDirs[i].getRaw());
if (dynamic_cast<SwapDir *>(Config.cacheSwap.swapDirs[i].getRaw())->
path, xstrerror());
}
}
- for (i = 0; i < (int)globbuf.gl_pathc; i++) {
+ for (i = 0; i < (int)globbuf.gl_pathc; ++i) {
error_count += parseOneConfigFile(globbuf.gl_pathv[i], depth);
}
globfree(&globbuf);
Vector<bool> if_states;
while (fgets(config_input_line, BUFSIZ, fp)) {
- config_lineno++;
+ ++config_lineno;
if ((token = strchr(config_input_line, '\n')))
*token = '\0';
continue; /* Not a valid #line directive, may be a comment */
while (*file && xisspace((unsigned char) *file))
- file++;
+ ++file;
if (*file) {
if (*file != '"')
err_count += parseManyConfigFiles(tmp_line + 8, depth + 1);
} else if (!parse_line(tmp_line)) {
debugs(3, 0, HERE << cfg_filename << ":" << config_lineno << " unrecognized: '" << tmp_line << "'");
- err_count++;
+ ++err_count;
}
}
char const * number_end = value;
while ((*number_end >= '0' && *number_end <= '9')) {
- number_end++;
+ ++number_end;
}
String number;
int i;
assert (entry);
- for (i = 0; i < swap.n_configured; i++) {
+ for (i = 0; i < swap.n_configured; ++i) {
s = dynamic_cast<SwapDir *>(swap.swapDirs[i].getRaw());
if (!s) continue;
storeAppendPrintf(entry, "%s %s %s", name, s->type(), s->path);
/* reconfigure existing dir */
- for (i = 0; i < swap->n_configured; i++) {
+ for (i = 0; i < swap->n_configured; ++i) {
assert (swap->swapDirs[i].getRaw());
if ((strcasecmp(path_str, dynamic_cast<SwapDir *>(swap->swapDirs[i].getRaw())->path)) == 0) {
char *mode, *nextmode;
for (mode = nextmode = tmp; mode; mode = nextmode) {
nextmode = strchr(mode, ',');
- if (nextmode)
- *nextmode++ = '\0';
+ if (nextmode) {
+ *nextmode = '\0';
+ ++nextmode;
+ }
if (!strcasecmp(mode, "no-clr")) {
if (p->options.htcp_only_clr)
fatalf("parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously");
if (*domain == '!') { /* check for !.edu */
l->do_ping = 0;
- domain++;
+ ++domain;
}
l->domain = xstrdup(domain);
}
while (*token && xisspace(*token))
- token++;
+ ++token;
if (!*token) {
self_destruct();
debugs(3, DBG_CRITICAL, s->protocol << "_port: missing ']' on IPv6 address: " << token);
self_destruct();
}
- *t++ = '\0';
+ *t = '\0';
+ ++t;
if (*t != ':') {
debugs(3, DBG_CRITICAL, s->protocol << "_port: missing Port in: " << token);
self_destruct();
s->tcp_keepalive.idle = atoi(t);
t = strchr(t, ',');
if (t) {
- t++;
+ ++t;
s->tcp_keepalive.interval = atoi(t);
t = strchr(t, ',');
}
if (t) {
- t++;
+ ++t;
s->tcp_keepalive.timeout = atoi(t);
t = strchr(t, ',');
}
const char *param;
if ( char *s = strchr(al, '{')) {
*s = '\0'; // terminate the al string
- s++;
+ ++s;
param = s;
s = strchr(s, '}');
if (!s) {
p->carp.load_factor = 0.0;
/* add it to our list of peers */
- *P++ = cbdataReference(p);
+ *P = cbdataReference(p);
+ ++P;
}
/* Sort our list on weight */
char *q = tmp_uri;
t = uri;
while (*t) {
- if (!xisspace(*t))
- *q++ = *t;
+ if (!xisspace(*t)) {
+ *q = *t;
+ ++q;
+ }
++t;
}
*q = '\0';
ListeningStartedDialer(&clientListenerConnectionOpened, s, Ipc::fdnHttpSocket, sub));
Ipc::StartListening(SOCK_STREAM, IPPROTO_TCP, s->listenConn, Ipc::fdnHttpSocket, listenCall);
- HttpSockets[NHttpSockets++] = -1; // set in clientListenerConnectionOpened
+ HttpSockets[NHttpSockets] = -1; // set in clientListenerConnectionOpened
+ ++NHttpSockets;
}
}
ListeningStartedDialer(&clientListenerConnectionOpened,
s, Ipc::fdnHttpsSocket, sub));
Ipc::StartListening(SOCK_STREAM, IPPROTO_TCP, s->listenConn, Ipc::fdnHttpsSocket, listenCall);
- HttpSockets[NHttpSockets++] = -1;
+ HttpSockets[NHttpSockets] = -1;
+ ++NHttpSockets;
}
}
#endif
}
++pos;
}
- *dt++ = '\0'; // nul-terminated the filename content string before system use.
+ *dt = '\0'; // nul-terminated the filename content string before system use.
+ ++dt;
debugs(4, 9, HERE << "STATE: dt='" << dt << "', lang='" << lang << "', pos=" << pos << ", buf='" << ((pos < hdr.size()) ? hdr.substr(pos,hdr.size()) : "") << "'");
if (member) {
/* Split in header and member */
- *member++ = '\0';
+ *member = '\0';
+ ++member;
- if (!xisalnum(*member))
- format->separator = *member++;
- else
+ if (!xisalnum(*member)) {
+ format->separator = *member;
+ ++member;
+ } else {
format->separator = ',';
+ }
format->member = xstrdup(member);
value = strchr(token, '=');
if (value) {
- *value++ = '\0'; /* terminate the token, and move up to the value */
+ *value = '\0'; /* terminate the token, and move up to the value */
+ ++value;
if (state->def->quote == external_acl::QUOTE_METHOD_URL)
rfc1738_unescape(value);
break;
case '\r':
- *p++ = '\\';
- *p++ = 'r';
+ *p = '\\';
+ ++p;
+ *p = 'r';
+ ++p;
++str;
break;
case '\n':
- *p++ = '\\';
- *p++ = 'n';
+ *p = '\\';
+ ++p;
+ *p = 'n';
+ ++p;
++str;
break;
case '\t':
- *p++ = '\\';
- *p++ = 't';
+ *p = '\\';
+ ++p;
+ *p = 't';
+ ++p;
++str;
break;
default:
- *p++ = '\\';
- *p++ = *str;
+ *p = '\\';
+ ++p;
+ *p = *str;
+ ++p;
++str;
break;
}
while ((c = *(const unsigned char *) header++) != '\0') {
#if !OLD_LOG_MIME
if (c == '\r') {
- *buf_cursor++ = '\\';
- *buf_cursor++ = 'r';
+ *buf_cursor = '\\';
+ ++buf_cursor;
+ *buf_cursor = 'r';
+ ++buf_cursor;
} else if (c == '\n') {
- *buf_cursor++ = '\\';
- *buf_cursor++ = 'n';
+ *buf_cursor = '\\';
+ ++buf_cursor;
+ *buf_cursor = 'n';
+ ++buf_cursor;
} else
#endif
if (c <= 0x1F
#endif
|| c == '['
|| c == ']') {
- *buf_cursor++ = '%';
+ *buf_cursor = '%';
+ ++buf_cursor;
i = c * 2;
- *buf_cursor++ = c2x[i];
- *buf_cursor++ = c2x[i + 1];
+ *buf_cursor = c2x[i];
+ ++buf_cursor;
+ *buf_cursor = c2x[i + 1];
+ ++buf_cursor;
#if !OLD_LOG_MIME
} else if (c == '\\') {
- *buf_cursor++ = '\\';
- *buf_cursor++ = '\\';
+ *buf_cursor = '\\';
+ ++buf_cursor;
+ *buf_cursor = '\\';
+ ++buf_cursor;
#endif
} else {
- *buf_cursor++ = (char) c;
+ *buf_cursor = (char) c;
+ ++buf_cursor;
}
}
char *cp = strchr(header, ':');
if (cp) {
- *cp++ = '\0';
+ *cp = '\0';
+ ++cp;
- if (*cp == ',' || *cp == ';' || *cp == ':')
- data.header.separator = *cp++;
- else
+ if (*cp == ',' || *cp == ';' || *cp == ':') {
+ data.header.separator = *cp;
+ ++cp;
+ } else {
data.header.separator = ',';
+ }
data.header.element = cp;
continue;
}
- f->names[f->name_count++] = xstrdup(answers[k].rdata);
+ f->names[f->name_count] = xstrdup(answers[k].rdata);
+ ++ f->name_count;
} else if (answers[k].type != RFC1035_TYPE_CNAME)
continue;
if (UFSSwapDir::FilenoBelongsHere(fn, D0, D1, D2))
continue;
- files[k++] = swapfileno;
+ files[k] = swapfileno;
+ ++k;
}
closedir(dir_pointer);
assert (usd);
- UFSDirToGlobalDirMapping[n++] = i;
+ UFSDirToGlobalDirMapping[n] = i;
+ ++n;
j += (usd->l1 * usd->l2);
}
return p;
}
- for (t = strtok(xbuf, w_space); t && n_tokens < MAX_TOKENS; t = strtok(NULL, w_space))
- tokens[n_tokens++] = xstrdup(t);
+ for (t = strtok(xbuf, w_space); t && n_tokens < MAX_TOKENS; t = strtok(NULL, w_space)) {
+ tokens[n_tokens] = xstrdup(t);
+ ++n_tokens;
+ }
xfree(xbuf);
ret = (char *)xmalloc(n);
for (p = (unsigned const char *)buf, r=(unsigned char *)ret; *p; ++p) {
- *r++ = *p;
+ *r = *p;
+ ++r;
- if (*p == 255)
- *r++ = 255;
+ if (*p == 255) {
+ *r = 255;
+ ++r;
+ }
}
- *r++ = '\0';
+ *r = '\0';
+ ++r;
assert((r - (unsigned char *)ret) == n );
return ret;
}
d = p;
p += strcspn(p, "/");
- if (*p)
- *p++ = '\0';
+ if (*p) {
+ *p = '\0';
+ ++p;
+ }
rfc1738_unescape(d);
selector = strchr(tline, TAB);
if (selector) {
- *selector++ = '\0';
+ *selector = '\0';
+ ++selector;
host = strchr(selector, TAB);
if (host) {
- *host++ = '\0';
+ *host = '\0';
+ ++host;
port = strchr(host, TAB);
if (port) {
snprintf(procname, strlen(shortname) + 3, "(%s)", shortname);
- args[nargs++] = procname;
+ args[nargs] = procname;
+ ++nargs;
- for (w = hlp->cmdline->next; w && nargs < HELPER_MAX_ARGS; w = w->next)
- args[nargs++] = w->key;
+ for (w = hlp->cmdline->next; w && nargs < HELPER_MAX_ARGS; w = w->next) {
+ args[nargs] = w->key;
+ ++nargs;
+ }
- args[nargs++] = NULL;
+ args[nargs] = NULL;
+ ++nargs;
assert(nargs <= HELPER_MAX_ARGS);
snprintf(procname, strlen(shortname) + 3, "(%s)", shortname);
- args[nargs++] = procname;
+ args[nargs] = procname;
+ ++nargs;
- for (wordlist *w = hlp->cmdline->next; w && nargs < HELPER_MAX_ARGS; w = w->next)
- args[nargs++] = w->key;
+ for (wordlist *w = hlp->cmdline->next; w && nargs < HELPER_MAX_ARGS; w = w->next) {
+ args[nargs] = w->key;
+ ++nargs;
+ }
- args[nargs++] = NULL;
+ args[nargs] = NULL;
+ ++nargs;
assert(nargs <= HELPER_MAX_ARGS);
if (t > srv->rbuf && t[-1] == '\r' && hlp->eom == '\n')
t[-1] = '\0';
- *t++ = '\0';
+ *t = '\0';
+ ++t;
if (hlp->childs.concurrency) {
i = strtol(msg, &msg, 10);
i = 0;
hash_first(addr_table);
- while ((n = (netdbEntry *) hash_next(addr_table)))
- *(list + i++) = n;
+ while ((n = (netdbEntry *) hash_next(addr_table))) {
+ *(list + i) = n;
+ ++i;
+ }
if (i != memInUse(MEM_NETDBENTRY))
debugs(38, 0, "WARNING: netdb_addrs count off, found " << i <<
if ( !addr.IsIPv4() )
continue;
- buf[i++] = (char) NETDB_EX_NETWORK;
+ buf[i] = (char) NETDB_EX_NETWORK;
+ ++i;
addr.GetInAddr(line_addr);
memcpy(&buf[i], &line_addr, sizeof(struct in_addr));
i += sizeof(struct in_addr);
- buf[i++] = (char) NETDB_EX_RTT;
+ buf[i] = (char) NETDB_EX_RTT;
+ ++i;
j = htonl((int) (n->rtt * 1000));
i += sizeof(int);
- buf[i++] = (char) NETDB_EX_HOPS;
+ buf[i] = (char) NETDB_EX_HOPS;
+ ++i;
j = htonl((int) (n->hops * 1000));
if (!facility)
facility = (char *) strchr(priority, '|');
if (facility) {
- *facility++ = '\0';
+ *facility = '\0';
+ ++facility;
ll->syslog_priority |= syslog_ntoa(facility);
}
ll->syslog_priority |= syslog_ntoa(priority);
static void loadSslErrorShortcutsMap()
{
assert(TheSslErrorShortcuts.empty());
- for (int i = 0; TheSslErrorShortcutsArray[i].name; i++)
+ for (int i = 0; TheSslErrorShortcutsArray[i].name; ++i)
TheSslErrorShortcuts[TheSslErrorShortcutsArray[i].name] = TheSslErrorShortcutsArray[i].errors;
}
// Should not be empty...
assert(it->second[0] != SSL_ERROR_NONE);
Ssl::Errors *errors = new Ssl::Errors(it->second[0]);
- for (int i =1; it->second[i] != SSL_ERROR_NONE; i++) {
+ for (int i =1; it->second[i] != SSL_ERROR_NONE; ++i) {
errors->push_back_unique(it->second[i]);
}
return errors;
}
// add new local storages.
- for (std::map<Ip::Address, size_t>::iterator conf_i = configureStorage.begin(); conf_i != configureStorage.end(); conf_i++ ) {
+ for (std::map<Ip::Address, size_t>::iterator conf_i = configureStorage.begin(); conf_i != configureStorage.end(); ++conf_i ) {
if (storage.find(conf_i->first) == storage.end()) {
storage.insert(std::pair<Ip::Address, LocalContextStorage *>(conf_i->first, new LocalContextStorage(conf_i->second)));
}
bool match = true;
if (cert1_altnames) {
int numalts = sk_GENERAL_NAME_num(cert1_altnames);
- for (int i = 0; match && i < numalts; i++) {
+ for (int i = 0; match && i < numalts; ++i) {
const GENERAL_NAME *aName = sk_GENERAL_NAME_value(cert1_altnames, i);
match = sk_GENERAL_NAME_find(cert2_altnames, aName);
}