source: buchla-68k/libsm/strltrm.c@ c65a0e2

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

Compiled full ROM in Hatari.

  • Property mode set to 100644
File size: 583 bytes
Line 
1/*
2 =============================================================================
3 strltrm() -- trim leading 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 *
13strltrm(s)
14register char *s;
15{
16 register char c;
17 register char *lp, *rp;
18
19 if (*s NE ' ')
20 return(s);
21
22 lp = s;
23 rp = s;
24
25 while (*rp EQ ' ')
26 ++rp;
27
28 while (c = *rp++)
29 *lp++ = c;
30
31 *lp = '\0';
32
33 return(s);
34}
Note: See TracBrowser for help on using the repository browser.