|
|
1.1 ! root 1: /* ! 2: * Coherent Standard I/O Library. ! 3: * Return a pointer to where a character ! 4: * appears in a string or NULL. ! 5: * Amended to return the location of (c == '\0') as well, rec 1983.12.12. ! 6: */ ! 7: ! 8: #include <stdio.h> ! 9: ! 10: char * ! 11: index(s, c) ! 12: register unsigned char *s; ! 13: register c; ! 14: { ! 15: do ! 16: if (*s == c) ! 17: return (s); ! 18: while (*s++ != '\0'); ! 19: return (NULL); ! 20: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.