2 ** trim.c -- strip leading and trailing whitespace ... inplace!
4 ** This code is Copyright (c) 2002, by the authors of nmh. See the
5 ** COPYRIGHT file in the root directory of the nmh distribution for
6 ** complete copyright information.
13 trim(unsigned char *cp)
17 /* skip over leading whitespace */
18 while (isspace(*cp)) {
22 /* start at the end and zap trailing whitespace */
23 for (sp = cp + strlen(cp) - 1; sp >= cp; sp--) {