mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00: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:
parent
5bc5f0762f
commit
48ed5a74bd
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user