void rtrim(char *str)
{
char *ps = str;
/* find <str> tail */
while( *ps != '/0' )
ps++;
ps—;
while( (ps >= str) && (*ps == ' ') )
ps—;
*(++ps) = '/0';
}
void ltrim(char *str)
{
char *pd = str;
while( *str == ' ' )
str++;
while( (*pd++ = *str++) != '/0' );
}