xml: simplify a bit - tscrape - twitter scraper | |
git clone git://git.codemadness.org/tscrape | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e3bd0af8ac5af175c7dee7c24eadf238f5f4334f | |
parent cb8ed18e7f5f31e68c9d5ab11a6daa8677af6636 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sat, 26 Aug 2017 13:43:22 +0200 | |
xml: simplify a bit | |
Diffstat: | |
M xml.c | 5 ++--- | |
1 file changed, 2 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/xml.c b/xml.c | |
@@ -280,10 +280,9 @@ xml_numericentitytostr(const char *e, char *buf, size_t bu… | |
else | |
l = strtoul(e, &end, 10); | |
/* invalid value or not a well-formed entity */ | |
- if (errno != 0 || (*end != '\0' && *end != ';')) | |
- return 0; | |
- if (!(len = xml_codepointtoutf8(l, &cp))) | |
+ if (errno || *end != ';') | |
return 0; | |
+ len = xml_codepointtoutf8(l, &cp); | |
/* make string */ | |
for (b = 0; b < len; b++) | |
buf[b] = (cp >> (8 * (len - 1 - b))) & 0xff; |