if (parsed_date < 0L) parsed_date = time(NULL);
lprintf(9, "Parsed date is %s",
asctime(localtime(&parsed_date)));
- sprintf(buf, "%ld", parsed_date );
+ snprintf(buf, sizeof buf, "%ld", parsed_date );
if (msg->cm_fields['T'] == NULL)
msg->cm_fields['T'] = strdoop(buf);
processed = 1;
else if (!strcasecmp(key, "From")) {
process_rfc822_addr(value, user, node, name);
lprintf(9, "Converted to <%s@%s> (%s)\n", user, node, name);
- sprintf(addr, "%s@%s", user, node);
+ snprintf(addr, sizeof addr, "%s@%s", user, node);
if (msg->cm_fields['A'] == NULL)
msg->cm_fields['A'] = strdoop(name);
processed = 1;
/* If there's no timestamp on this message, set it to now. */
if (msg->cm_fields['T'] == NULL) {
- sprintf(buf, "%ld", time(NULL));
+ snprintf(buf, sizeof buf, "%ld", time(NULL));
msg->cm_fields['T'] = strdoop(buf);
}