Last change
on this file since a6f5b95 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
553 bytes
|
Line | |
---|
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 |
|
---|
11 | char *
|
---|
12 | memchr(sp, c, n)
|
---|
13 | register char *sp, c;
|
---|
14 | register int n;
|
---|
15 | {
|
---|
16 | while (--n >= 0)
|
---|
17 | if (*sp++ == c)
|
---|
18 | return(--sp);
|
---|
19 | return((char *)0);
|
---|
20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.