summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed_frames.c4
-rw-r--r--sfeed_html.c5
-rw-r--r--sfeed_plain.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index c73a91d..b34a26d 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -161,8 +161,10 @@ main(int argc, char *argv[])
if (!(feeds = calloc(argc, sizeof(struct feed *))))
err(1, "calloc");
+ if ((comparetime = time(NULL)) == -1)
+ err(1, "time");
/* 1 day is old news */
- comparetime = time(NULL) - 86400;
+ comparetime -= 86400;
/* write main index page */
if (!(fpindex = fopen("index.html", "w+b")))
diff --git a/sfeed_html.c b/sfeed_html.c
index 707f341..efd39db 100644
--- a/sfeed_html.c
+++ b/sfeed_html.c
@@ -75,9 +75,10 @@ main(int argc, char *argv[])
if (!(feeds = calloc(argc, sizeof(struct feed *))))
err(1, "calloc");
-
+ if ((comparetime = time(NULL)) == -1)
+ err(1, "time");
/* 1 day old is old news */
- comparetime = time(NULL) - 86400;
+ comparetime -= 86400;
fputs("<!DOCTYPE HTML>\n"
"<html>\n"
diff --git a/sfeed_plain.c b/sfeed_plain.c
index f3ffcf7..4942d92 100644
--- a/sfeed_plain.c
+++ b/sfeed_plain.c
@@ -40,8 +40,10 @@ main(int argc, char *argv[])
char *name;
int i;
+ if ((comparetime = time(NULL)) == -1)
+ err(1, "time");
/* 1 day is old news */
- comparetime = time(NULL) - (3600 * 24);
+ comparetime -= 86400;
if (argc == 1) {
printfeed(stdin, "");