sfeed

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

commit ef324a31bb75a27a1af4059d327f3a6125053b33
parent a48030e2a36f248f36549ae82c973fd1ad6ef924
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon, 31 Mar 2014 23:17:16 +0200

small cleanup

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
Msfeed_plain.c | 12++++++------
Msfeed_web.c | 2+-
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sfeed_plain.c b/sfeed_plain.c @@ -5,7 +5,7 @@ #include "util.h" -void +static void printutf8padded(const char *s, size_t len, FILE *fp, int pad) { size_t n = 0, i; @@ -22,18 +22,18 @@ int main(void) { char *line = NULL, *fields[FieldLast]; time_t parsedtime, comparetime; - unsigned int isnew; size_t size = 0; comparetime = time(NULL) - (3600 * 24); /* 1 day is old news */ while(parseline(&line, &size, fields, FieldLast, '\t', stdin) > 0) { - isnew = (parsedtime >= comparetime); parsedtime = (time_t)strtol(fields[FieldUnixTimestamp], NULL, 10); - printf(" %c ", isnew ? 'N' : ' '); + if(parsedtime >= comparetime) + fputs(" N ", stdout); + else + fputs(" ", stdout); if(fields[FieldFeedName][0] != '\0') printf("%-15.15s ", fields[FieldFeedName]); - printf("%-30.30s", fields[FieldTimeFormatted]); - fputs(" ", stdout); + printf("%-30.30s ", fields[FieldTimeFormatted]); printutf8padded(fields[FieldTitle], 70, stdout, ' '); fputs(" ", stdout); if(fields[FieldBaseSiteUrl][0] != '\0') diff --git a/sfeed_web.c b/sfeed_web.c @@ -68,5 +68,5 @@ main(int argc, char **argv) { xmlparser_parse(&x); - return found ? EXIT_SUCCESS : EXIT_FAILURE; + return found > 0 ? EXIT_SUCCESS : EXIT_FAILURE; }