sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 28b37c1c8c9d798edfa65163f9f8d5d6e5628d2f
parent 5003c693a993833fdea2efe986dc59746a91959a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun,  4 Nov 2018 18:25:24 +0100

whitespace and comment fix

Diffstat:
Msfeed_html.c | 4++--
Msfeed_mbox.c | 2+-
Msfeed_plain.c | 4++--
Msfeed_tail.c | 4++--
Msfeed_twtxt.c | 4++--
5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sfeed_html.c b/sfeed_html.c @@ -43,7 +43,7 @@ printfeed(FILE *fp, struct feed *f) parsedtime = 0; if (strtotime(fields[FieldUnixTimestamp], &parsedtime)) continue; - if (!(tm = localtime(&parsedtime))) + if (!(tm = localtime(&parsedtime))) err(1, "localtime"); isnew = (parsedtime >= comparetime) ? 1 : 0; @@ -53,7 +53,7 @@ printfeed(FILE *fp, struct feed *f) f->totalnew += isnew; f->total++; - fprintf(stdout, "%04d-%02d-%02d&nbsp;%02d:%02d ", + fprintf(stdout, "%04d-%02d-%02d&nbsp;%02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); if (isnew) diff --git a/sfeed_mbox.c b/sfeed_mbox.c @@ -92,7 +92,7 @@ printfeed(FILE *fp, const char *feedname) /* 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)) + "%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"); diff --git a/sfeed_plain.c b/sfeed_plain.c @@ -31,7 +31,7 @@ printfeed(FILE *fp, const char *feedname) parsedtime = 0; if (strtotime(fields[FieldUnixTimestamp], &parsedtime)) continue; - if (!(tm = localtime(&parsedtime))) + if (!(tm = localtime(&parsedtime))) err(1, "localtime"); if (parsedtime >= comparetime) @@ -44,7 +44,7 @@ printfeed(FILE *fp, const char *feedname) fputs(" ", stdout); } - fprintf(stdout, "%04d-%02d-%02d %02d:%02d ", + fprintf(stdout, "%04d-%02d-%02d %02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); printutf8pad(stdout, fields[FieldTitle], 70, ' '); diff --git a/sfeed_tail.c b/sfeed_tail.c @@ -106,7 +106,7 @@ printfeed(FILE *fp, const char *feedname) fputs(" ", stdout); } - fprintf(stdout, "%04d-%02d-%02d %02d:%02d ", + fprintf(stdout, "%04d-%02d-%02d %02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); printutf8pad(stdout, fields[FieldTitle], 70, ' '); @@ -147,7 +147,7 @@ main(int argc, char *argv[]) if (!(fp = fopen(argv[i], "r"))) { if (firsttime) err(1, "fopen: %s", argv[i]); - /* NOTE: don't report when the file is missing */ + /* don't report when the file is missing after the first run */ continue; } if (fstat(fileno(fp), &st) == -1) { diff --git a/sfeed_twtxt.c b/sfeed_twtxt.c @@ -27,10 +27,10 @@ printfeed(FILE *fp, const char *feedname) parsedtime = 0; if (strtotime(fields[FieldUnixTimestamp], &parsedtime)) continue; - if (!(tm = gmtime(&parsedtime))) + if (!(tm = gmtime(&parsedtime))) err(1, "localtime"); - fprintf(stdout, "%04d-%02d-%02dT%02d:%02d:%02dZ\t", + fprintf(stdout, "%04d-%02d-%02dT%02d:%02d:%02dZ\t", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); if (feedname[0])