summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-05-08 13:09:36 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-05-08 13:09:36 +0000
commit2403a08e72a8d6284caf023713337b597e78bb87 (patch)
treed70a0321c6d7c4959f89db570cd1fb012e17800a
parent956b5f67049a004ecec4070a7cb1ea2a8f5cd2ef (diff)
sfeed_xmlenc: add newline if value is set
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r--sfeed_xmlenc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sfeed_xmlenc.c b/sfeed_xmlenc.c
index b760a18..e7cdaae 100644
--- a/sfeed_xmlenc.c
+++ b/sfeed_xmlenc.c
@@ -24,8 +24,11 @@ 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) {
if(isxmlpi && (!strncasecmp(name, "encoding", namelen))) {
- for(; *value; value++)
- putc(tolower((int)*value), stdout); /* output lowercase */
+ if(*value) {
+ for(; *value; value++)
+ putc(tolower((int)*value), stdout); /* output lowercase */
+ putchar('\n');
+ }
exit(EXIT_SUCCESS);
}
}