aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-03-24 18:51:55 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-03-24 18:51:55 +1300
commit8289d35e3ec7d716250f41b272b92bdb53640cb6 (patch)
tree508eb47d72214388b0667c68cbd1ff78d5e3b784
parentAdd clean to .PHONY (diff)
downloadrssd-8289d35e3ec7d716250f41b272b92bdb53640cb6.tar.gz
rssd-8289d35e3ec7d716250f41b272b92bdb53640cb6.zip
Don't print title/desc if download failed
18:50:27 <CorySadowski> lmao what 18:50:31 <CorySadowski> I think it fucked up 18:51:17 <tom> not building? 18:51:17 <CorySadowski> it got an error 2 on one feed, so it decided to reprint the description of the one above it, namely maddox's 18:51:23 <tom> haha 18:51:26 <tom> MY FIRST BUG
-rw-r--r--rssd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rssd.c b/rssd.c
index 1511ca6..e3057ba 100644
--- a/rssd.c
+++ b/rssd.c
@@ -11,8 +11,10 @@ int main(void)
fprintf(stderr, "Processing URL: %s\n", url);
err = mrss_parse_url(url, &feed);
fprintf(stderr, "Error value: %u\n", err);
- fprintf(stderr, "Feed title: %s\n", feed->title);
- fprintf(stderr, "Feed description: %s\n", feed->description);
+ if (err == 0) {
+ fprintf(stderr, "Feed title: %s\n", feed->title);
+ fprintf(stderr, "Feed description: %s\n", feed->description);
+ }
}
exit(EXIT_SUCCESS);