From 8ee47f51fcf05db74c3db3c8276c3b6acc93e0a3 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 2 Apr 2014 16:07:26 +0200 Subject: sfeed_opml_import: use strlcpy Signed-off-by: Hiltjo Posthuma --- sfeed_opml_import.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c index a5a3a30..cce73a3 100644 --- a/sfeed_opml_import.c +++ b/sfeed_opml_import.c @@ -30,7 +30,8 @@ xml_handler_start_element(XMLParser *p, const char *tag, size_t taglen) { static void xml_handler_end_element(XMLParser *p, const char *tag, size_t taglen, - int isshort) { + int isshort) +{ if(istag(tag, "outline")) { printf("\tfeed \"%s\" \"%s\" \"%s\"\n", feedname[0] ? feedname : "unnamed", @@ -41,14 +42,15 @@ xml_handler_end_element(XMLParser *p, const char *tag, size_t taglen, static void xml_handler_attr(XMLParser *p, const char *tag, size_t taglen, - const char *name, size_t namelen, const char *value, size_t valuelen) { + const char *name, size_t namelen, const char *value, size_t valuelen) +{ if(istag(tag, "outline")) { if(isattr(name, "text") || isattr(name, "title")) - strncpy(feedname, value, sizeof(feedname) - 1); + strlcpy(feedname, value, sizeof(feedname)); else if(isattr(name, "htmlurl")) - strncpy(basesiteurl, value, sizeof(basesiteurl) - 1); + strlcpy(basesiteurl, value, sizeof(basesiteurl)); else if(isattr(name, "xmlurl")) - strncpy(feedurl, value, sizeof(feedurl) - 1); + strlcpy(feedurl, value, sizeof(feedurl)); } } -- cgit v1.2.3