diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-10-08 19:22:35 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-10-08 19:22:35 +0200 |
commit | 53a05e3562a0c27b2ab1240c5ba55d7da87d3c75 (patch) | |
tree | 7a6496bd4c9c737aeddccc28f73ec0c9484b7cc1 | |
parent | fe817dc355d52f6842f3d73f81bd5c8129f94604 (diff) |
sfeed_mbox: remove an unneeded strlcpy call
-rw-r--r-- | sfeed_mbox.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sfeed_mbox.c b/sfeed_mbox.c index 911500f..0f24d00 100644 --- a/sfeed_mbox.c +++ b/sfeed_mbox.c @@ -86,16 +86,17 @@ printfeed(FILE *fp, const char *feedname) parsedtime = 0; if (strtotime(fields[FieldUnixTimestamp], &parsedtime)) continue; - /* can't convert: default to formatted time for time_t 0. */ - if (!gmtime_r(&parsedtime, &tm) || - !strftime(timebuf, sizeof(timebuf), - "%a, %d %b %Y %H:%M:%S +0000", &tm)) - strlcpy(timebuf, "Thu, 01 Jan 1970 00:00:00 +0000", - sizeof(timebuf)); /* mbox + mail header */ printf("From MAILER-DAEMON %s\n", mtimebuf); - printf("Date: %s\n", timebuf); + /* can't convert: default to formatted time for time_t 0. */ + if (gmtime_r(&parsedtime, &tm) && + strftime(timebuf, sizeof(timebuf), + "%a, %d %b %Y %H:%M:%S +0000", &tm)) + printf("Date: %s\n", timebuf); + else + printf("Date: Thu, 01 Jan 1970 00:00:00 +0000\n"); + printf("From: %s <sfeed@>\n", fields[FieldAuthor][0] ? fields[FieldAuthor] : "unknown"); printf("To: %s <%s@%s>\n", user, user, host); if (feedname[0]) |