summaryrefslogtreecommitdiff
path: root/com32/lib/strnlen.c
blob: d073561e5d4786318ab3d1cfb2ccfdd4b643bb8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 * strnlen()
 */

#include <string.h>

size_t strnlen(const char *s, size_t n)
{
  const char *ss = s;
  while ( n-- && *ss )
    ss++;
  return ss-s;
}