summaryrefslogtreecommitdiffstats
path: root/main/glib/strlen.c
blob: 6c665eb44db524d8c35848644252d3ec0178ff03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "config.h"
#include <ctype.h>
#include "genlib.h"
#include "stddefs.h"

/* strlen():
 * Returns the number of
 * non-NULL bytes in string argument.
 */
int
strlen(register char *s)
{
	register char *s0 = s + 1;

	while (*s++ != '\0')
		;
	return (s - s0);
}