sfeed

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

commit a869ac25e174b7179f13557dd0a23840bf2cf327
parent 97a069df32404705b9c5782cae338a0ea39f4535
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sat, 28 Jun 2014 15:53:32 +0200

sfeed: fix check for div in atom content

as suspected it should match the tagname exactly "div", it would match <diva> too :P

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
Msfeed.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sfeed.c b/sfeed.c @@ -499,11 +499,12 @@ xml_handler_attr(XMLParser *p, const char *tag, size_t taglen, static void xml_handler_start_element(XMLParser *p, const char *name, size_t namelen) { if(ctx.iscontenttag) { - /* starts with div, handle as XML, don't convert entities */ - /* TODO: test properly */ + /* starts with div, handle as XML, don't convert entities (set handle to NULL) */ if(ctx.item.feedtype == FeedTypeAtom && - !strncmp(name, "div", strlen("div"))) /* TODO: strncmp -> strcmp? */ + namelen == strlen("div") && + !strncmp(name, "div", strlen("div"))) { p->xmldataentity = NULL; + } } if(ctx.iscontent) { ctx.attrcount = 0;