/[monit]/monit/util.c
ViewVC logotype

Diff of /monit/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.140 by hauk, Sun Jan 9 01:03:36 2005 UTC revision 1.141 by hauk, Sun Jan 9 01:16:08 2005 UTC
# Line 188  char *Util_trim(char *s) { Line 188  char *Util_trim(char *s) {
188   * @return s with leading spaces removed   * @return s with leading spaces removed
189   */   */
190  char *Util_ltrim(char *s) {  char *Util_ltrim(char *s) {
191      
192    char *t= s;    char *t= s;
193    
194    ASSERT(s);    ASSERT(s);
195    
196    while(*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') t++;    while(*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') t++;
197    if(t!=s) {    if(t!=s) {
198      memmove(s, t, t-s);      int l= strlen(t);
199      s[t-s]= 0;      memmove(s, t, l);
200        s[l]= 0;
201    }    }
202        
203    return s;    return s;

Legend:
Removed from v.1.140  
changed lines
  Added in v.1.141

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26