#include #include #include #include "vlbutil.h" #include "logio.h" /*....................................................................... * Given an input string and a length, place a '\0' terminator after the * last printable character (except space) to terminate the string there. * If the last character up to the length given is a non-space character * then that is overwritten with the '\0' terminator. Thus you should * send length of the string including space for the terminator. * * Input/Output: * instr char * The input string of length >= slen. * Input: * slen int The max length of the new string including the * character for the '\0' terminator. * Output: * return int The length of the reduced version of 'instr' * excluding the '\0' terminator. */ int termstr(char *instr, int slen) { static int i; for(i=slen-1; i>=0 && !isgraph((int)instr[i]); i--); /* * We have gone one character too far. */ if(i nco-1) slen = nco - 1; /* * Copy slen characters from istr to ostr. */ for(co=0, cptr=ostr; co