Last change
on this file since d21fc6f was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Zero redundant declarations.
|
-
Property mode
set to
100644
|
File size:
867 bytes
|
Rev | Line | |
---|
[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | strccpy.c -- copy string up to specified character
|
---|
| 4 | Version 1 -- 1987-04-03 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /*
|
---|
| 9 | =============================================================================
|
---|
| 10 | strccpy(s1, s2, c) -- copy string up to specified character
|
---|
| 11 |
|
---|
| 12 | Copy string s2 to s1 up to but not including the first occurrence of c.
|
---|
| 13 | s1 must be large enough to contain the copied bytes.
|
---|
| 14 | No checking is done. Character c is not copied. Returns s1.
|
---|
| 15 | =============================================================================
|
---|
| 16 | */
|
---|
| 17 |
|
---|
[b28a12e] | 18 | #include "ram.h"
|
---|
[6262b5c] | 19 |
|
---|
[7258c6a] | 20 | int8_t *strccpy(int8_t *s1, int8_t *s2, int8_t c)
|
---|
[f40a309] | 21 | {
|
---|
[7848656] | 22 | register int8_t *os1;
|
---|
[7258c6a] | 23 | register int8_t x;
|
---|
[f40a309] | 24 |
|
---|
[7848656] | 25 | os1 = s1;
|
---|
[f40a309] | 26 |
|
---|
[7848656] | 27 | while(c != (x = *s1++))
|
---|
[f40a309] | 28 | *s2++ = x;
|
---|
| 29 |
|
---|
[7848656] | 30 | return(os1);
|
---|
[f40a309] | 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.