check the returned length of xml_entitytostr() properly - grabtitle - stupid HTML title grabber
 (HTM) git clone git://git.codemadness.org/grabtitle
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit dcb355c8766619ad66061167c55b9f44c6ab7569
 (DIR) parent 1c506adc3502530014355ae774f8b306e9a8f4bb
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Wed, 12 Dec 2018 19:04:56 +0100
       
       check the returned length of xml_entitytostr() properly
       
       ... this shouldn't matter though since the buffer is always big enough here.
       
       Diffstat:
         M grabtitle.c                         |       2 +-
       
       1 file changed, 1 insertion(+), 1 deletion(-)
       ---
 (DIR) diff --git a/grabtitle.c b/grabtitle.c
       @@ -71,7 +71,7 @@ xmldataentity(XMLParser *p, const char *d, size_t dl)
                char buf[16];
                ssize_t len;
        
       -        if ((len = xml_entitytostr(d, buf, sizeof(buf))))
       +        if ((len = xml_entitytostr(d, buf, sizeof(buf))) > 0)
                        xmldata(p, buf, (size_t)len);
                else
                        xmldata(p, d, dl);