summaryrefslogtreecommitdiffstats
path: root/main/glib/strlen.c
blob: 5a01a158169286b0c9ccf9d795cafeca6ad2877c (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);
}