if (len > slen)
return (NULL);
} while (strncmp(s, find, len) != 0);
- s--;
+ --s;
}
return s;
}
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;
#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);
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",
if (p[0] != ' ')
return 0;
}
- p++;
+ ++p;
}
/* Trailing whitespace? */
if (xisspace(p[0]))
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
} else {
ldapServer = xstrdup(value);
}
- argc--;
- argv++;
+ --argc;
+ ++argv;
}
if (!ldapServer)
ldapServer = xstrdup("localhost");
break;
default:
*escaped++ = *src++;
- n++;
- size--;
+ ++n;
+ --size;
}
}
*escaped = '\0';
strncpy(ServerArray[Serversqueried].pdc, ParamPDC, NTHOSTLEN - 1);
strncpy(ServerArray[Serversqueried].bdc, ParamBDC, NTHOSTLEN - 1);
strncpy(ServerArray[Serversqueried].domain, ParamDomain, NTHOSTLEN - 1);
- Serversqueried++;
+ ++Serversqueried;
}
/*
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;
}
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;
(uf->Alloc >> 1) * sizeof(*uf->names));
}
uf->names[uf->Inuse] = xstrdup(buf);
- uf->Inuse++;
+ ++uf->Inuse;
}
fclose(fp);
fp = NULL;
if (*salt == '$') {
magic = salt++;
while (*salt && *salt != '$')
- salt++;
+ ++salt;
if (*salt == '$') {
- salt++;
+ ++salt;
magiclen = salt - magic;
} else {
salt = magic;
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 */
* 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));
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';
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);
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;
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';
*/
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;
result = TRUE;
break;
}
- pTmpBuf++;
- dwTotalCount++;
+ ++pTmpBuf;
+ ++dwTotalCount;
}
}
} else
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;
}
break;
default:
*escaped++ = *src++;
- n++;
- size--;
+ ++n;
+ --size;
}
}
*escaped = '\0';
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();
password = *value;
break;
}
- value++;
+ ++value;
}
debug("password: %s\n", password);
if (password)
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();
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",
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
} else {
ldapServer = xstrdup(value);
}
- argc--;
- argv++;
+ --argc;
+ ++argv;
}
if (!ldapServer)
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;
}
break;
default:
*escaped++ = *src++;
- n++;
- size--;
+ ++n;
+ --size;
}
}
*escaped = '\0';
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();
password = *value;
break;
}
- value++;
+ ++value;
}
debug("password: %s\n", password);
if (password)
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();
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",
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
} else {
ldapServer = xstrdup(value);
}
- argc--;
- argv++;
+ --argc;
+ ++argv;
}
if (!ldapServer)
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;
}
debug("Windows group: %S, Squid group: %S\n", str, *array);
if (wcscmp(str, *array) == 0)
return 0;
- array++;
+ ++array;
}
return -1;
}
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;
}
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;
result = 1;
break;
}
- pTmpBuf++;
- dwTotalCount++;
+ ++pTmpBuf;
+ ++dwTotalCount;
}
}
} else {
result = 1;
break;
}
- tmp++;
+ ++tmp;
}
} else
debug("Valid_Global_Groups: ADsGetObject for %S failed, ERROR: %s\n", User_LDAP_path, Get_WIN32_ErrorMessage(hr));
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;
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
} else {
ldapServer = xstrdup(value);
}
- argc--;
- argv++;
+ --argc;
+ ++argv;
}
if (!ldapServer)
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",
break;
default:
*escaped++ = *src++;
- n++;
- size--;
+ ++n;
+ --size;
}
}
*escaped = '\0';
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;
}
break;
case '\\':
- templ++;
+ ++templ;
if (*templ) {
*filter++ = *templ++;
- size--;
+ --size;
}
break;
default:
*filter++ = *templ++;
- size--;
+ --size;
break;
}
}
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;
}
result = 1;
break;
}
- pTmpBuf++;
- dwTotalCount++;
+ ++pTmpBuf;
+ ++dwTotalCount;
}
}
} else
result = 1;
break;
}
- pTmpBuf++;
- dwTotalCount++;
+ ++pTmpBuf;
+ ++dwTotalCount;
}
}
} else {
va_end(ap);
if (x > 0) {
dbuf[x] = '\0';
- x++;
+ ++x;
fputs(dbuf, stdout);
*(dbuf) = '\0';
} else {
// 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);
// 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);
// 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);
// omit the delimiter
if (*p == chr) {
- p++;
- i++;
+ ++p;
+ ++i;
} else {
// chr not found
memset(In_Obj, 0, In_Sz);
/* 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) {
memcpy(bufb, p, i);
*p = '\0';
bufb[i] = '\0';
- swi++; /* Indicates that there is a bufb */
+ ++swi; /* Indicates that there is a bufb */
}
}
}
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);
}
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) {
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)
}
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)
}
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 {
}
break;
case 'H':
- i++; /* Set Hostname */
+ ++i; /* Set Hostname */
if (argv[i] != NULL)
xstrncpy(edui_conf.host, argv[i], sizeof(edui_conf.host));
else {
}
break;
case 'p':
- i++; /* Set port */
+ ++i; /* Set port */
if (argv[i] != NULL)
edui_conf.port = atoi(argv[i]);
else {
}
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 {
}
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 {
}
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 {
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;
}
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 {
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 */
if (nuser || nuser8) {
if (nuser) {
*nuser = '\0';
- nuser++;
+ ++nuser;
} else {
*nuser8 = '\0';
nuser = nuser8 + 3;
} else if (domain) {
strup(domain);
*domain = '\0';
- domain++;
+ ++domain;
}
if (!domain && margs.ddomain) {
domain = xstrdup(margs.ddomain);
{
while (*s) {
*s = toupper((unsigned char) *s);
- s++;
+ ++s;
}
}
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;
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);
break;
if (up[n] == '@') {
ul[nl] = '@';
- nl++;
- n++;
+ ++nl;
+ ++n;
continue;
}
ival = up[n];
xfree(ul);
return NULL;
}
- n++;
+ ++n;
ival = up[n];
if (ival > 64 && ival < 71)
ichar = ichar + ival - 55;
} else if (iUTF2 > 0xC3 && iUTF2 < 0xE0 && ichar > 0x7F && ichar < 0xC0) {
iUTF2 = 0;
ul[nl] = ichar;
- nl++;
+ ++nl;
} else {
iUTF2 = 0;
ul[nl] = ichar;
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;
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;
} 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';
xfree(ul);
return NULL;
}
- n++;
+ ++n;
}
ul[nl] = '\0';
}
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 */
return (1);
}
*p = '\0';
- p++;
+ ++p;
gdsp = init_gd();
gdsp->group = gp;
if (gdspn) /* Have already an existing structure */
return (1);
}
*p = '\0';
- p++;
+ ++p;
if (dp) { /* end of domain name */
gdsp->domain = xstrdup(dp);
dp = NULL;
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);
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);
for (dp = domain; *dp; dp++) {
if (*dp == '.')
- i++;
+ ++i;
}
/*
* add dc= and
ldf = ldf + 3;
} else {
*ldf = *filter;
- ldf++;
+ ++ldf;
}
}
*ldf = '\0';
port = 389;
if ((p = strchr(host, ':'))) {
*p = '\0';
- p++;
+ ++p;
port = atoi(p);
}
nhosts = get_hostname_list(margs, &hlist, 0, host);
}
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 */
return (1);
}
*p = '\0';
- p++;
+ ++p;
lssp = init_ls();
lssp->lserver = xstrdup(np);
if (lsspn) /* Have already an existing structure */
return (1);
}
*p = '\0';
- p++;
+ ++p;
if (dp) { /* end of domain name */
lssp->domain = xstrdup(dp);
dp = NULL;
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);
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)
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)
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)
}
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 */
return (1);
}
*p = '\0';
- p++;
+ ++p;
ndsp = init_nd();
ndsp->netbios = xstrdup(np);
if (ndspn) /* Have already an existing structure */
return (1);
}
*p = '\0';
- p++;
+ ++p;
if (dp) { /* end of domain name */
ndsp->domain = xstrdup(dp);
dp = NULL;
}
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);
hres_list = hres;
count = 0;
while (hres_list) {
- count++;
+ ++count;
hres_list = hres_list->ai_next;
}
hres_list = hres;
*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));
hp[nhosts].port = -1;
hp[nhosts].priority = -1;
hp[nhosts].weight = -1;
- nhosts++;
+ ++nhosts;
hres_list = hres_list->ai_next;
}
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));
hp[nhosts].port = -1;
hp[nhosts].priority = -2;
hp[nhosts].weight = -2;
- nhosts++;
+ ++nhosts;
}
ls = ls->next;
hp[nh].port = port;
hp[nh].priority = priority;
hp[nh].weight = weight;
- nh++;
+ ++nh;
p += size;
} else {
p += rdlength;
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));
}
}
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);
}
}
if (rc)
return rc;
- interact++;
+ ++interact;
}
return LDAP_SUCCESS;
#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_
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,
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 {
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))
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");
}
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");
}
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);
*/
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;
result = TRUE;
break;
}
- pTmpBuf++;
- dwTotalCount++;
+ ++pTmpBuf;
+ ++dwTotalCount;
}
}
} else
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 */
/* capitalize */
uc(c);
uc(d);
- numcontrollers++;
+ ++numcontrollers;
new_dc->domain = d;
new_dc->controller = c;
new_dc->dead = 0;
{
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) {
debug("load balancing. Selected controller #%d\n", n);
while (n > 0) {
current_dc = current_dc->next;
- n--;
+ --n;
}
}
while (1) {