|
Last change
on this file since 599d89b was 0580615, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
|
Point of no return.
|
-
Property mode
set to
100644
|
|
File size:
527 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 |
|
|---|
| [0580615] | 12 | char *strrtrm(char *s)
|
|---|
| [f40a309] | 13 | {
|
|---|
| 14 | register char *lp, *rp;
|
|---|
| 15 |
|
|---|
| 16 | lp = s;
|
|---|
| 17 | rp = s;
|
|---|
| 18 |
|
|---|
| 19 | while (*rp)
|
|---|
| 20 | ++rp;
|
|---|
| 21 |
|
|---|
| 22 | while ((long)(--rp) GE (long)lp) {
|
|---|
| 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.