9os

Experimental kernel using plan9 ideas for embedded device
git clone git://git.simple-cc.org/9os
Log | Files | Refs | README | LICENSE

strnlen.c (151B)


      1 #include <string.h>
      2 
      3 #undef strnlen
      4 
      5 size_t
      6 strnlen(const char *s, size_t maxlen)
      7 {
      8 	size_t n;
      9 
     10 	for (n = 0; n < maxlen && *s++; ++n)
     11 		;
     12 	return n;
     13 }