source: buchla-68k/libsm/strrtrm.c@ 0580615

Last change on this file since 0580615 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Point of no return.

  • Property mode set to 100644
File size: 527 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 "stddefs.h"
11
12char *strrtrm(char *s)
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.