shithub: riscv

ref: acfc389bb90944f3ac1200eec4a80b49adaf4e6a
dir: /sys/src/ape/lib/ap/gen/strnlen.c/

View raw version
#include <string.h>

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

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