summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed_plain.c12
-rw-r--r--sfeed_web.c2
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;
}