} else
hostname = xstrdup(NILVALUE);
- if ((size_t) xasprintf(&ctl->hdr, "<%d>%.15s %s %.200s%s: ",
- ctl->pri, rfc3164_current_time(),
- hostname, ctl->tag, pid) > ctl->max_message_size)
- errx(EXIT_FAILURE, _("maximal message size is smaller than message header"));
-
+ xasprintf(&ctl->hdr, "<%d>%.15s %s %.200s%s: ",
+ ctl->pri, rfc3164_current_time(), hostname, ctl->tag, pid);
free(hostname);
}
if (!structured)
structured = xstrdup(NILVALUE);
- if ((size_t) xasprintf(&ctl->hdr, "<%d>1 %s %s %s %s %s %s ",
- ctl->pri,
- time,
- hostname,
- app_name,
- procid,
- msgid,
- structured) > ctl->max_message_size)
- errx(EXIT_FAILURE, _("maximal message size is smaller than message header"));
+ xasprintf(&ctl->hdr, "<%d>1 %s %s %s %s %s %s ",
+ ctl->pri,
+ time,
+ hostname,
+ app_name,
+ procid,
+ msgid,
+ structured);
free(time);
free(hostname);
else
pid[0] = '\0';
- if ((size_t) xasprintf(&ctl->hdr, "<%d>%s %s%s: ", ctl->pri, rfc3164_current_time(),
- ctl->tag, pid) > ctl->max_message_size)
- errx(EXIT_FAILURE, _("maximal message size is smaller than message header"));
+ xasprintf(&ctl->hdr, "<%d>%s %s%s: ", ctl->pri, rfc3164_current_time(),
+ ctl->tag, pid);
}
static void generate_syslog_header(struct logger_ctl *const ctl)