From 13927fc6083c3d134e456ccfafb953c6cea17662 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 27 Feb 2016 16:21:30 +0100 Subject: various improvements - pledge tools and add define to enable it on platforms that support it, currently only OpenBSD 5.9+ - separate getline and parseline functionality. - use murmur3 hash instead of jenkins1: faster and less collisions. - make some error messages a bit more clear, for example with path truncation. - some small cleanups, move printutf8pad to util. --- sfeed_html.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sfeed_html.c') diff --git a/sfeed_html.c b/sfeed_html.c index e5f27b5..dd8bdfd 100644 --- a/sfeed_html.c +++ b/sfeed_html.c @@ -31,7 +31,9 @@ printfeed(FILE *fp, struct feed *f) } fputs("\n", stdout); - while (parseline(&line, &linesize, fields, fp) > 0) { + while (getline(&line, &linesize, fp) > 0) { + if (!parseline(line, fields)) + break; parsedtime = 0; strtotime(fields[FieldUnixTimestamp], &parsedtime); @@ -73,6 +75,9 @@ main(int argc, char *argv[]) FILE *fp; int i; + if (pledge(argc == 1 ? "stdio" : "stdio rpath", NULL) == -1) + err(1, "pledge"); + if (!(feeds = calloc(argc, sizeof(struct feed *)))) err(1, "calloc"); if ((comparetime = time(NULL)) == -1) -- cgit v1.2.3