diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-24 18:51:55 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-24 18:51:55 +1300 |
commit | 8289d35e3ec7d716250f41b272b92bdb53640cb6 (patch) | |
tree | 508eb47d72214388b0667c68cbd1ff78d5e3b784 | |
parent | Add clean to .PHONY (diff) | |
download | rssd-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |