if (s != NULL) {
addr = strdup(s);
striplt(addr);
- if (strlen(addr) > 0) {
+ if (!IsEmptyStr(addr)) {
if (callback != NULL) {
callback(addr, citadel_address);
}
while (s = vcard_get_prop(v, "email;internet", 0, instance++, 0), s != NULL) {
addr = strdup(s);
striplt(addr);
- if (strlen(addr) > 0) {
+ if (!IsEmptyStr(addr)) {
if ( (IsDirectory(addr, 1)) ||
(!local_addrs_only) ) {
++saved_instance;
sprintf(buf, "http://%s/%s.vfb",
config.c_fqdn,
usbuf.fullname);
- for (i=0; i<strlen(buf); ++i) {
+ for (i=0; !IsEmptyStr(&buf[i]); ++i) {
if (buf[i] == ' ') buf[i] = '_';
}
vcard_set_prop(v, "FBURL;PREF", buf, 0);
if (a==2) strcpy(tmpcity, buf);
if (a==3) strcpy(tmpstate, buf);
if (a==4) {
- for (c=0; c<strlen(buf); ++c) {
+ for (c=0; !IsEmptyStr(&buf[c]); ++c) {
if ((buf[c]>='0') && (buf[c]<='9')) {
b = strlen(tmpzip);
tmpzip[b] = buf[c];
v = vcard_new();
if (v == NULL) return;
sprintf(buf, "%s@%s", usbuf->fullname, config.c_fqdn);
- for (i=0; i<strlen(buf); ++i) {
+ for (i=0; !IsEmptyStr(&buf[i]); ++i) {
if (buf[i] == ' ') buf[i] = '_';
}
vcard_add_prop(v, "fn", usbuf->fullname);
int linelen;
if (msgnum <= 0L) return;
+
+ if (room == NULL) return;
if (strcasecmp(room, ADDRESS_BOOK_ROOM)) {
return;
cprintf("%d valid screen names:\n", LISTING_FOLLOWS);
cprintf("%s\n", CC->user.fullname);
- if ( (strlen(CC->cs_inet_fn) > 0) && (strcasecmp(CC->user.fullname, CC->cs_inet_fn)) ) {
+ if ( (!IsEmptyStr(CC->cs_inet_fn)) && (strcasecmp(CC->user.fullname, CC->cs_inet_fn)) ) {
cprintf("%s\n", CC->cs_inet_fn);
}
cprintf("000\n");
if (CtdlAccessCheck(ac_logged_in)) return;
cprintf("%d valid email addresses:\n", LISTING_FOLLOWS);
- if (strlen(CC->cs_inet_email) > 0) {
+ if (!IsEmptyStr(CC->cs_inet_email)) {
cprintf("%s\n", CC->cs_inet_email);
}
- if (strlen(CC->cs_inet_other_emails) > 0) {
+ if (!IsEmptyStr(CC->cs_inet_other_emails)) {
num_secondary_emails = num_tokens(CC->cs_inet_other_emails, '|');
for (i=0; i<num_secondary_emails; ++i) {
extract_token(buf, CC->cs_inet_other_emails,i,'|',sizeof CC->cs_inet_other_emails);
vcard_set_prop(v, "email;internet", email, 0);
snprintf(uid, sizeof uid, "collected: %s %s@%s", name, user, node);
- for (i=0; i<strlen(uid); ++i) {
+ for (i=0; !IsEmptyStr(&uid[i]); ++i) {
if (isspace(uid[i])) uid[i] = '_';
uid[i] = tolower(uid[i]);
}
CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
strip_addresses_already_have, aptr->collected_addresses);
- if (strlen(aptr->collected_addresses) > 0)
+ if (!IsEmptyStr(aptr->collected_addresses))
for (i=0; i<num_tokens(aptr->collected_addresses, ','); ++i) {
/* Make a vCard out of each address */