diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-12-14 12:49:00 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-12-14 12:49:00 +0100 |
commit | 91ed017ca773e14d128d4a8c0edb8654b333214e (patch) | |
tree | 9fa5589e191a88b4f454469f0c1b5f87f7ec9b2f | |
parent | f62993ca41830aaa55a0e985f10ecc4fd55eda44 (diff) |
sfeed: rename buffer to buf, change entitytostr check, it can never happen
-rw-r--r-- | sfeed.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -641,7 +641,7 @@ xml_handler_data(XMLParser *p, const char *s, size_t len) static void xml_handler_data_entity(XMLParser *p, const char *data, size_t datalen) { - char buffer[16]; + char buf[16]; ssize_t len; if (!ctx.field) @@ -649,13 +649,8 @@ xml_handler_data_entity(XMLParser *p, const char *data, size_t datalen) /* try to translate entity, else just pass as data to * xml_data_handler. */ - len = xml_entitytostr(data, buffer, sizeof(buffer)); - /* this should never happen (buffer too small) */ - if (len < 0) - return; - - if (len > 0) - xml_handler_data(p, buffer, (size_t)len); + if ((len = xml_entitytostr(data, buf, sizeof(buf))) > 0) + xml_handler_data(p, buf, (size_t)len); else xml_handler_data(p, data, datalen); } |