From 2403a08e72a8d6284caf023713337b597e78bb87 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Thu, 8 May 2014 13:09:36 +0000 Subject: sfeed_xmlenc: add newline if value is set Signed-off-by: Hiltjo Posthuma --- sfeed_xmlenc.c | 7 +++++-- 1 file 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); } } -- cgit v1.2.3