diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-03-31 23:17:16 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-03-31 23:17:16 +0200 |
commit | ef324a31bb75a27a1af4059d327f3a6125053b33 (patch) | |
tree | 1f9d59c5dd6de0e692adbd485c4c78e380514269 | |
parent | a48030e2a36f248f36549ae82c973fd1ad6ef924 (diff) |
small cleanup
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r-- | sfeed_plain.c | 12 | ||||
-rw-r--r-- | sfeed_web.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sfeed_plain.c b/sfeed_plain.c index c3e2ef9..a3fc5c3 100644 --- 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 index c4bcb33..d9cb052 100644 --- 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;
}
|