shithub: scc

ref: ad390eef16b53905245bf16859082c9a52b35c6c
dir: /lib/c/strnlen.c/

View raw version
#include <string.h>

#undef strnlen

size_t
strnlen(const char *s, size_t maxlen)
{
	size_t n;

	for (n = 0; n < maxlen && *s++; ++n)
		;
	return n;
}