diff options
Diffstat (limited to 'sfeed_plain.c')
-rw-r--r-- | sfeed_plain.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/sfeed_plain.c b/sfeed_plain.c index c790ec4..f8ce7ec 100644 --- a/sfeed_plain.c +++ b/sfeed_plain.c @@ -2,7 +2,6 @@ #include <locale.h> #include <stdio.h> -#include <stdlib.h> #include <string.h> #include <time.h> @@ -53,9 +52,8 @@ int main(int argc, char *argv[]) { FILE *fp; - char *name, *tmp, *endptr; + char *name; int i; - long l; if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); @@ -65,18 +63,8 @@ main(int argc, char *argv[]) if (pledge(argc == 1 ? "stdio" : "stdio rpath", NULL) == -1) err(1, "pledge"); - if ((comparetime = time(NULL)) == (time_t)-1) - errx(1, "time"); - - if ((tmp = getenv("SFEED_NEW_MAX_SECS"))) { - l = strtol(tmp, &endptr, 10); - if (*tmp == '\0' || *endptr != '\0' || l <= 0) - err(1, "cannot parse $SFEED_NEW_MAX_SECS"); - comparetime -= l; - } else { - /* 1 day is old news */ - comparetime -= 86400; - } + if ((comparetime = getcomparetime()) == (time_t)-1) + errx(1, "getcomparetime"); if (argc == 1) { printfeed(stdin, ""); |