From f7a4160d3fad90f7d78c6a7a79f3bc74e09f29bb Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 10 Mar 2020 18:03:24 +0100 Subject: sfeed_web: fix exit status code - Fix a theoretical issue where "found" can overflow and return a zero exit status when there are many feeds found. - When there are no RSS/Atom feeds this is not an error, so return 0. - Style: change unsigned int to int. --- sfeed_web.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sfeed_web.c b/sfeed_web.c index 745d88e..563b0b3 100644 --- a/sfeed_web.c +++ b/sfeed_web.c @@ -10,7 +10,7 @@ #define STRP(s) s,sizeof(s)-1 static XMLParser parser; -static unsigned int isbase, islink, isfeedlink, found; +static int isbase, islink, isfeedlink; static char abslink[4096], feedlink[4096], basehref[4096], feedtype[256]; static void @@ -45,7 +45,6 @@ xmltagstartparsed(XMLParser *p, const char *t, size_t tl, int isshort) putchar('\t'); printfeedtype(feedtype, stdout); putchar('\n'); - found++; } static void @@ -85,5 +84,5 @@ main(int argc, char *argv[]) /* NOTE: getnext is defined in xml.h for inline optimization */ xml_parse(&parser); - return found > 0 ? 0 : 1; + return 0; } -- cgit v1.2.3