1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Update xmlStrlen() to use POSIX / ISO C strlen()

This should be faster on a wide range of platforms.

Closes #212
This commit is contained in:
Mike Dalessio 2022-02-21 09:35:59 -05:00 committed by Nick Wellnhofer
parent 5bc5f0762f
commit 48ed5a74bd

View File

@ -424,13 +424,7 @@ xmlStrsub(const xmlChar *str, int start, int len) {
int
xmlStrlen(const xmlChar *str) {
size_t len = 0;
if (str == NULL) return(0);
while (*str != 0) { /* non input consuming */
str++;
len++;
}
size_t len = str ? strlen((const char *)str) : 0;
return(len > INT_MAX ? 0 : len);
}