shithub: npe

ref: cdc06f177f6e2b9f4a4e354ac10dabfae0fd459a
dir: /libnpe/strnlen.c/

View raw version
#include <string.h>

size_t
strnlen(char *s, size_t maxlen)
{
	size_t i;

	for (i = 0; i < maxlen && s[i] != '\0'; i++)
		;
	return i;
}