diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-04-02 16:07:26 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-04-02 16:07:26 +0200 |
commit | 8ee47f51fcf05db74c3db3c8276c3b6acc93e0a3 (patch) | |
tree | 26ed795fd0c3d9ac2eef99d99ef86f02c6d95e07 | |
parent | c6d7f2956d5d8508641915e5f6202401f809eb3b (diff) |
sfeed_opml_import: use strlcpy
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r-- | sfeed_opml_import.c | 12 |
1 files 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)); } } |