Commit | Line | Data |
---|---|---|
6c685f97 KB |
1 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | |
785f99ec KB |
3 | * All rights reserved. |
4 | * | |
6c685f97 | 5 | * %sccs.include.redist.c% |
d98205b9 BJ |
6 | */ |
7 | ||
785f99ec | 8 | #if defined(LIBC_SCCS) && !defined(lint) |
6c685f97 | 9 | static char sccsid[] = "@(#)strlen.c 5.4 (Berkeley) %G%"; |
785f99ec KB |
10 | #endif /* LIBC_SCCS and not lint */ |
11 | ||
6c685f97 KB |
12 | #include <sys/stdc.h> |
13 | #include <string.h> | |
14 | ||
15 | size_t | |
785f99ec | 16 | strlen(str) |
6c685f97 | 17 | const char *str; |
d98205b9 | 18 | { |
6c685f97 | 19 | register const char *s; |
d98205b9 | 20 | |
6c685f97 KB |
21 | for (s = str; *s; ++s); |
22 | return(s - str); | |
d98205b9 | 23 | } |
6c685f97 | 24 |