From 2352bea1534c5cfe13018cbc04b9026f5dda60f7 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 24 Jun 2020 23:34:09 +0100 Subject: use the ascii locale safe handling instead of ctype API --- content/handlers/html/box_construct.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'content/handlers') diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c index 5edd88ed2..e2eaf8ca6 100644 --- a/content/handlers/html/box_construct.c +++ b/content/handlers/html/box_construct.c @@ -25,6 +25,7 @@ * Implementation of conversion from DOM tree to box tree. */ +#include #include #include "utils/errors.h" @@ -967,20 +968,20 @@ box_text_transform(char *s, unsigned int len, enum css_text_transform_e tt) case CSS_TEXT_TRANSFORM_UPPERCASE: for (i = 0; i < len; ++i) if ((unsigned char) s[i] < 0x80) - s[i] = toupper(s[i]); + s[i] = ascii_to_upper(s[i]); break; case CSS_TEXT_TRANSFORM_LOWERCASE: for (i = 0; i < len; ++i) if ((unsigned char) s[i] < 0x80) - s[i] = tolower(s[i]); + s[i] = ascii_to_lower(s[i]); break; case CSS_TEXT_TRANSFORM_CAPITALIZE: if ((unsigned char) s[0] < 0x80) - s[0] = toupper(s[0]); + s[0] = ascii_to_upper(s[0]); for (i = 1; i < len; ++i) if ((unsigned char) s[i] < 0x80 && - isspace(s[i - 1])) - s[i] = toupper(s[i]); + ascii_is_space(s[i - 1])) + s[i] = ascii_to_upper(s[i]); break; default: break; -- cgit v1.2.3