bionic: Fix strnlen to work with length of -1
This is used to mean INT_MAX.
This commit is contained in:
parent
a066600558
commit
f82c53bfdc
2 changed files with 5 additions and 2 deletions
2
bionic.c
2
bionic.c
|
@ -697,7 +697,7 @@ int _strlen(const char *s)
|
|||
return i;
|
||||
}
|
||||
|
||||
int _strnlen(const char *s, int maxlen)
|
||||
int _strnlen(const char *s, uint32_t maxlen)
|
||||
{
|
||||
int i = 0;
|
||||
while(s[i++] && i < maxlen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue