2023-11-16 23:19:36 -05:00

14 lines
159 B
C

/*
* strnlen()
*/
#include <string.h>
size_t strnlen(const char *s, size_t n)
{
const char *ss = s;
while (n-- && *ss)
ss++;
return ss - s;
}