diff options
-rw-r--r-- | sfeed_xmlenc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sfeed_xmlenc.c b/sfeed_xmlenc.c index e192f62..500064b 100644 --- a/sfeed_xmlenc.c +++ b/sfeed_xmlenc.c @@ -10,7 +10,8 @@ static int isxmlpi = 0, tags = 0; static void xmltagstart(XMLParser *p, const char *tag, size_t taglen) { - if(tags > 3) /* optimization: try to find processing instruction at start */ + /* optimization: try to find processing instruction at start */ + if(tags > 3) exit(EXIT_FAILURE); isxmlpi = (!strncasecmp(tag, "?xml", taglen)) ? 1 : 0; tags++; @@ -22,11 +23,14 @@ xmltagend(XMLParser *p, const char *tag, size_t taglen, int isshort) { } static void -xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name, size_t namelen, const char *value, size_t valuelen) { +xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name, + size_t namelen, const char *value, size_t valuelen) +{ if(isxmlpi && (!strncasecmp(name, "encoding", namelen))) { if(*value) { + /* output lowercase */ for(; *value; value++) - putc(tolower((int)*value), stdout); /* output lowercase */ + putc(tolower((int)*value), stdout); putchar('\n'); } exit(EXIT_SUCCESS); |