src/stdlib/strwhite.c
/*================================
 * trim -- Trim string if too long
 *  returns static buffer (or NULL)
 *==============================*/
- Trim string if too long
returns static buffer (or NULL)
- Trim string if too long returns static buffer ( or NULL )
STRING
trim (STRING str, INT len)
{
	static char scratch[MAXLINELEN+1];
	if (!str || strlen(str) > MAXLINELEN) return NULL;
	if (len < 0) len = 0;
	if (len > MAXLINELEN) len = MAXLINELEN;
	strcpy(scratch, str);
	scratch[len] = '\0';
	return scratch;
}
STRING trim ( STRING str , INT len ) { static char scratch [ MAXLINELEN + 1 ] ; if ( ! str || strlen ( str ) > MAXLINELEN ) return NULL ; if ( len < 0 ) len = 0 ; if ( len > MAXLINELEN ) len = MAXLINELEN ; strcpy ( scratch , str ) ; scratch [ len ] = ' \0 ' ; return scratch ; }
trim -- Trim string if too long
  returns static buffer (or NULL)
trim -- Trim string if too long returns static buffer ( or NULL )