Last change
on this file since 5c977dd was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Zero redundant declarations.
|
-
Property mode
set to
100644
|
File size:
504 bytes
|
Rev | Line | |
---|
[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | memchr.c -- search a string for a character
|
---|
| 4 | Version 1 -- 1987-06-12
|
---|
| 5 |
|
---|
[5c13d64] | 6 | Return the ptr in vp at which the character c appears;
|
---|
[f40a309] | 7 | NULL if not found in n chars; don't stop at \0.
|
---|
| 8 | =============================================================================
|
---|
| 9 | */
|
---|
| 10 |
|
---|
[b28a12e] | 11 | #include "ram.h"
|
---|
[6262b5c] | 12 |
|
---|
[7258c6a] | 13 | void *memchr(void *vp, int8_t c, int16_t n)
|
---|
[f40a309] | 14 | {
|
---|
[7258c6a] | 15 | int8_t *cp = vp;
|
---|
[5c13d64] | 16 |
|
---|
| 17 | while (--n >= 0)
|
---|
| 18 | if (*cp++ == c)
|
---|
| 19 | return(--cp);
|
---|
| 20 |
|
---|
| 21 | return((void *)0);
|
---|
[f40a309] | 22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.