Last change
on this file since 7bb1284 was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Zero redundant declarations.
|
-
Property mode
set to
100644
|
File size:
536 bytes
|
Line | |
---|
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 "ram.h"
|
---|
11 |
|
---|
12 | int8_t *strrtrm(int8_t *s)
|
---|
13 | {
|
---|
14 | register int8_t *lp, *rp;
|
---|
15 |
|
---|
16 | lp = s;
|
---|
17 | rp = s;
|
---|
18 |
|
---|
19 | while (*rp)
|
---|
20 | ++rp;
|
---|
21 |
|
---|
22 | while ((int32_t)(--rp) GE (int32_t)lp) {
|
---|
23 |
|
---|
24 | if (*rp EQ ' ')
|
---|
25 | *rp = '\0';
|
---|
26 | else
|
---|
27 | break;
|
---|
28 | }
|
---|
29 |
|
---|
30 | return(lp);
|
---|
31 | }
|
---|
32 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.