Commit dcf18681 authored by rswindell's avatar rswindell
Browse files

Created local truncsp implementation.

parent b4369464
...@@ -321,6 +321,18 @@ if(difftime(now,savetime)>=60) { ...@@ -321,6 +321,18 @@ if(difftime(now,savetime)>=60) {
savetime=now; } savetime=now; }
} }
/****************************************************************************/
/* Truncates white-space chars off end of 'str' */
/****************************************************************************/
static void truncsp(char *str)
{
uint c;
c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--;
str[c]=0;
}
/****************************************************************************/ /****************************************************************************/
/* General menu function, see uifc.h for details. */ /* General menu function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
...@@ -1590,23 +1602,6 @@ sprintf(str,"%s %s %02d %4d %02d:%02d %s",wday,mon,gm->tm_mday,1900+gm->tm_year ...@@ -1590,23 +1602,6 @@ sprintf(str,"%s %s %02d %4d %02d:%02d %s",wday,mon,gm->tm_mday,1900+gm->tm_year
return(str); return(str);
} }
#if 0
/****************************************************************************/
/* Truncates white-space chars off end of 'str' and terminates at first tab */
/****************************************************************************/
void truncsp(char *str)
{
char c,tmp[256];
tmp[0]=TAB;
tmp[1]=0;
str[strcspn(str,tmp)]=0;
c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--;
str[c]=0;
}
#endif
/****************************************************************************/ /****************************************************************************/
/* Status popup/down function, see uifc.h for details. */ /* Status popup/down function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
......
...@@ -156,6 +156,17 @@ static int which(char* prompt, int max) ...@@ -156,6 +156,17 @@ static int which(char* prompt, int max)
} }
} }
/****************************************************************************/
/* Truncates white-space chars off end of 'str' */
/****************************************************************************/
static void truncsp(char *str)
{
uint c;
c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--;
str[c]=0;
}
/****************************************************************************/ /****************************************************************************/
/* General menu function, see uifc.h for details. */ /* General menu function, see uifc.h for details. */
/****************************************************************************/ /****************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment