]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/Extras/libh/length.c
Replaced use of snprintf() with memcpy()/memmove().
[nmh] / docs / historical / mh-jun-1982 / Extras / libh / length.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 /* return length of a string, not counting the null terminator */
9 length(str)
10 char *str;
11 {
12 register char *cp;
13
14 for (cp = str; *cp++; );
15 return(cp-str-1);
16 }