Last change
on this file since 002f873 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Point of no return.
|
-
Property mode
set to
100644
|
File size:
509 bytes
|
Rev | Line | |
---|
[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | memchr.c -- search a string for a character
|
---|
| 4 | Version 1 -- 1987-06-12
|
---|
| 5 |
|
---|
| 6 | Return the ptr in sp at which the character c appears;
|
---|
| 7 | NULL if not found in n chars; don't stop at \0.
|
---|
| 8 | =============================================================================
|
---|
| 9 | */
|
---|
| 10 |
|
---|
[0580615] | 11 | char *memchr(char *sp, char c, int n)
|
---|
[f40a309] | 12 | {
|
---|
| 13 | while (--n >= 0)
|
---|
| 14 | if (*sp++ == c)
|
---|
| 15 | return(--sp);
|
---|
| 16 | return((char *)0);
|
---|
| 17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.