sfeed

simple feed reader - forked from git.codemadness.org/sfeed
git clone git://src.gearsix.net/sfeed
Log | Files | Refs | Atom | README | LICENSE

commit c1c5db91a1591048dbce73760691c12fa76e8e2b
parent 394ffefd882b99bdbfead397ccab0b771ec4b0fe
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed,  5 Aug 2015 12:50:18 +0200

sfeed_mbox: combine date check condition

Diffstat:
Msfeed_mbox.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sfeed_mbox.c b/sfeed_mbox.c @@ -77,11 +77,9 @@ printfeed(FILE *fp, const char *feedname) errx(1, "can't format current time"); while (parseline(&line, &linesize, fields, fp) > 0) { - if ((r = strtotime(fields[FieldUnixTimestamp], &parsedtime)) == -1) - continue; /* invalid date */ - if (!gmtime_r(&parsedtime, &tm)) - continue; /* invalid date */ - if (!strftime(timebuf, sizeof(timebuf), + if ((r = strtotime(fields[FieldUnixTimestamp], &parsedtime)) == -1 || + !gmtime_r(&parsedtime, &tm) || + !strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M +0000", &tm)) continue; /* invalid date */