commit 74ab0e9629125dc9afd029feb822673c8544ead0
parent 1aa126a9ce2e3afa42f3e5e73363d853c277ad2d
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 13 May 2014 12:52:50 +0000
sfeed_xmlenc: linewrap
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git 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);