diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-05-13 12:52:50 +0000 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-05-13 12:52:50 +0000 |
commit | 74ab0e9629125dc9afd029feb822673c8544ead0 (patch) | |
tree | 87eb4239b921381f74d8120c490613a2490a33bd | |
parent | 1aa126a9ce2e3afa42f3e5e73363d853c277ad2d (diff) |
sfeed_xmlenc: linewrap
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-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); |