summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-06-24 23:34:09 +0100
committerVincent Sanders <vince@kyllikki.org>2020-06-24 23:34:09 +0100
commit2352bea1534c5cfe13018cbc04b9026f5dda60f7 (patch)
tree1d57051b6f22fc146da08d66da4d20207b2b6513 /content/handlers/html
parent567390f59da4e9ae0adc3fc22b1be4ebbf6b7b62 (diff)
downloadnetsurf-2352bea1534c5cfe13018cbc04b9026f5dda60f7.tar.gz
netsurf-2352bea1534c5cfe13018cbc04b9026f5dda60f7.tar.bz2
use the ascii locale safe handling instead of ctype API
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/box_construct.c11
1 files changed, 6 insertions, 5 deletions
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 <string.h>
#include <dom/dom.h>
#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;