shithub: scc

ref: 4dd43534558d8e24534d263a3bc1ca748052af9a
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;
}