sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit baea971bfbe98c8503d464d2934fb32b50eab6b7
parent 7e6245aa708526949100478f5847704a7dd6eac2
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun,  4 Oct 2015 23:36:35 +0200

sfeed_mbox: small cleanup, move label so check for NUL isnt needed

Diffstat:
Msfeed_mbox.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sfeed_mbox.c b/sfeed_mbox.c @@ -40,8 +40,8 @@ printcontent(const char *s, FILE *fp) if (!strncmp(s, "From ", 5)) fputc('>', fp); - for (; *s; s++) { read: + for (; *s; s++) { switch (*s) { case '\\': switch (*(++s)) { @@ -58,7 +58,6 @@ read: goto read; } break; - case '\0': return; /* ignore */ case '\n': fputc((int)*s, fp); for (s++; *s && *s == '>'; s++) @@ -149,8 +148,7 @@ main(int argc, char *argv[]) printfeed(stdin, ""); } else { for (i = 1; i < argc; i++) { - fp = fopen(argv[i], "r"); - if (!fp) + if (!(fp = fopen(argv[i], "r"))) err(1, "fopen: %s", argv[i]); name = xbasename(argv[i]); printfeed(fp, name);