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

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

Unix line breaks.

  • Property mode set to 100644
File size: 531 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 *
13strrtrm(s)
14char *s;
15{
16 register char *lp, *rp;
17
18 lp = s;
19 rp = s;
20
21 while (*rp)
22 ++rp;
23
24 while ((long)(--rp) GE (long)lp) {
25
26 if (*rp EQ ' ')
27 *rp = '\0';
28 else
29 break;
30 }
31
32 return(lp);
33}
Note: See TracBrowser for help on using the repository browser.