summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2020-03-10 18:03:24 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-03-11 10:11:50 +0100
commitf7a4160d3fad90f7d78c6a7a79f3bc74e09f29bb (patch)
tree726845f541f6bfed086a1f60d0f867ed68b00707
parent3b537abbd3e6442e904efce902cb4d22678eab1d (diff)
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.
-rw-r--r--sfeed_web.c5
1 files 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;
}