/* We just want the top-level dc, not the whole hierarchy */
strcpy(topdc, config.c_ldap_base_dn);
- for (i=0; i<strlen(topdc); ++i) {
- if (topdc[i] == ',') topdc[i] = 0;
+ for (i=0; !IsEmptyStr(&topdc[i]); ++i) {
+ if (topdc[i] == ',') {
+ topdc[i] = 0;
+ break;
+ }
}
- for (i=0; i<strlen(topdc); ++i) {
+ for (i=0; !IsEmptyStr(&topdc[i]); ++i) {
if (topdc[i] == '=') strcpy(topdc, &topdc[i+1]);
}
*/
if ( (!strcasecmp(v->prop[i].name, "fburl"))
||(!strncasecmp(v->prop[i].name, "fburl;", 6)) ) {
- if ( (strlen(calFBURL) == 0)
+ if ( (IsEmptyStr(calFBURL))
|| (!strncasecmp(v->prop[i].name, "fburl;pref", 10)) ) {
safestrncpy(calFBURL, v->prop[i].value, sizeof calFBURL);
}
attrs[num_attrs-1]->mod_values[1] = NULL;
/* "givenname" (first name) based on info in vCard */
- if (strlen(givenname) == 0) strcpy(givenname, "_");
- if (strlen(sn) == 0) strcpy(sn, "_");
+ if (IsEmptyStr(givenname)) strcpy(givenname, "_");
+ if (IsEmptyStr(sn)) strcpy(sn, "_");
attrs = realloc(attrs, (sizeof(LDAPMod *) * ++num_attrs) );
attrs[num_attrs-1] = malloc(sizeof(LDAPMod));
memset(attrs[num_attrs-1], 0, sizeof(LDAPMod));
}
/* Add a "calFBURL" attribute if a calendar free/busy URL exists */
- if (strlen(calFBURL) > 0) {
+ if (!IsEmptyStr(calFBURL)) {
attrs = realloc(attrs, (sizeof(LDAPMod *) * ++num_attrs) );
attrs[num_attrs-1] = malloc(sizeof(LDAPMod));
memset(attrs[num_attrs-1], 0, sizeof(LDAPMod));
#ifdef HAVE_LDAP
CtdlRegisterCleanupHook(serv_ldap_cleanup);
- if (strlen(config.c_ldap_host) > 0) {
+ if (!IsEmptyStr(config.c_ldap_host)) {
CtdlConnectToLdap();
}