fxlibc/src/libc/string/strnlen.c

9 lines
118 B
C

#include <string.h>
size_t strnlen(char const *s, size_t n)
{
size_t i = 0;
while(s[i] && i < n) i++;
return i;
}