source:
buchla-68k/libsm/strlen.c@
e225e77
Last change on this file since e225e77 was 7848656, checked in by , 7 years ago | |
---|---|
|
|
File size: 428 bytes |
Rev | Line | |
---|---|---|
[f40a309] | 1 | /* |
2 | ============================================================================= | |
3 | strlen.c -- string length function ala' Unix(tm) | |
4 | Version 1 -- 1987-02-11 -- D.N. Lynx Crowe | |
5 | ||
6 | Returns the number of non-NULL bytes in string argument. | |
7 | ============================================================================= | |
8 | */ | |
9 | ||
10 | ||
[7258c6a] | 11 | int16_t strlen(int8_t *s) |
[f40a309] | 12 | { |
[7848656] | 13 | register int16_t n = 0; |
[f40a309] | 14 | |
[7848656] | 15 | while (*s++ != '\0') |
16 | ++n; | |
[f40a309] | 17 | |
[7848656] | 18 | return (n); |
[f40a309] | 19 | } |
Note:
See TracBrowser
for help on using the repository browser.