source:
buchla-68k/libsm/strlen.c@
d21fc6f
Last change on this file since d21fc6f was b28a12e, checked in by , 7 years ago | |
---|---|
|
|
File size: 445 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 | ||
[b28a12e] | 10 | #include "ram.h" |
[f40a309] | 11 | |
[7258c6a] | 12 | int16_t strlen(int8_t *s) |
[f40a309] | 13 | { |
[7848656] | 14 | register int16_t n = 0; |
[f40a309] | 15 | |
[7848656] | 16 | while (*s++ != '\0') |
17 | ++n; | |
[f40a309] | 18 | |
[7848656] | 19 | return (n); |
[f40a309] | 20 | } |
Note:
See TracBrowser
for help on using the repository browser.