Fix build on windows

This commit is contained in:
Kovid Goyal 2024-09-13 12:13:59 +05:30
parent 289192f595
commit ae3277b17f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -75,7 +75,7 @@ is_xml_unsafe(uint32_t codepoint) {
return codepoint == '<' || codepoint == '>' || codepoint == '&' || codepoint == '"' || codepoint == '\''; return codepoint == '<' || codepoint == '>' || codepoint == '&' || codepoint == '"' || codepoint == '\'';
} }
static ssize_t static int
convert_entity(const char *entity, const size_t elen, char *output, bool keep_xml_entities) { convert_entity(const char *entity, const size_t elen, char *output, bool keep_xml_entities) {
if (entity[0] == '#') { if (entity[0] == '#') {
if (elen < 2) return -1; if (elen < 2) return -1;
@ -99,7 +99,7 @@ convert_entity(const char *entity, const size_t elen, char *output, bool keep_xm
static size_t static size_t
add_entity(const char *entity, const size_t elen, char *output, bool keep_xml_entities) { add_entity(const char *entity, const size_t elen, char *output, bool keep_xml_entities) {
ssize_t ans; int ans;
if (elen > 64 || elen < 3 || (ans = convert_entity(entity + 1, elen - 2, output, keep_xml_entities)) < 0) { if (elen > 64 || elen < 3 || (ans = convert_entity(entity + 1, elen - 2, output, keep_xml_entities)) < 0) {
memcpy(output, entity, elen); memcpy(output, entity, elen);
return elen; return elen;