Last change
on this file since 411371e was 7258c6a, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Use standard integer types.
|
-
Property mode
set to
100644
|
File size:
539 bytes
|
Rev | Line | |
---|
[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | strrtrm() -- trim trailing blanks from a string, in-place
|
---|
| 4 | Version 1 -- 1988-08-19 -- D.N. Lynx Crowe
|
---|
| 5 |
|
---|
| 6 | Returns a pointer to the string.
|
---|
| 7 | =============================================================================
|
---|
| 8 | */
|
---|
| 9 |
|
---|
| 10 | #include "stddefs.h"
|
---|
| 11 |
|
---|
[7258c6a] | 12 | int8_t *strrtrm(int8_t *s)
|
---|
[f40a309] | 13 | {
|
---|
[7258c6a] | 14 | register int8_t *lp, *rp;
|
---|
[f40a309] | 15 |
|
---|
| 16 | lp = s;
|
---|
| 17 | rp = s;
|
---|
| 18 |
|
---|
| 19 | while (*rp)
|
---|
| 20 | ++rp;
|
---|
| 21 |
|
---|
[7258c6a] | 22 | while ((int32_t)(--rp) GE (int32_t)lp) {
|
---|
[f40a309] | 23 |
|
---|
| 24 | if (*rp EQ ' ')
|
---|
| 25 | *rp = '\0';
|
---|
| 26 | else
|
---|
| 27 | break;
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | return(lp);
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.