icalproperty *attendee = NULL;
char summary_string[SIZ];
icalproperty *summary = NULL;
+ size_t reqsize;
if (cal == NULL) {
lprintf(CTDL_ERR, "ERROR: trying to reply to NULL event?\n");
icalcomponent_free(encaps); /* Don't need this anymore. */
if (serialized_request == NULL) return;
- request_message_text = malloc(strlen(serialized_request) + SIZ);
+ reqsize = strlen(serialized_request) + SIZ;
+ request_message_text = malloc(reqsize);
if (request_message_text != NULL) {
- sprintf(request_message_text,
+ snprintf(request_message_text, reqsize,
"Content-type: text/calendar\r\n\r\n%s\r\n",
serialized_request
);
strcpy(content_type, "text/plain");
mptr = bmstrcasestr(msg->cm_fields['M'], "Content-type:");
if (mptr != NULL) {
+ char *aptr;
safestrncpy(content_type, &mptr[13], sizeof content_type);
striplt(content_type);
- for (a = 0; a < strlen(content_type); ++a) {
- if ((content_type[a] == ';')
- || (content_type[a] == ' ')
- || (content_type[a] == 13)
- || (content_type[a] == 10)) {
- content_type[a] = 0;
+ aptr = content_type;
+ while (!IsEmptyStr(aptr)) {
+ if ((*aptr == ';')
+ || (*aptr == ' ')
+ || (*aptr == 13)
+ || (*aptr == 10)) {
+ *aptr = 0;
}
+ else aptr++;
}
}
}
}
striplt(this_recp);
+ if (IsEmptyStr(this_recp))
+ break;
lprintf(CTDL_DEBUG, "Evaluating recipient #%d: %s\n", num_recps, this_recp);
++num_recps;
mailtype = alias(this_recp);