-
-/*
- * trimcpy.c -- strip leading and trailing whitespace,
+/* trimcpy.c -- strip leading and trailing whitespace,
* -- replace internal whitespace with spaces,
* -- then return a copy.
*
/* skip over leading whitespace */
while (isspace ((unsigned char) *sp)) ++sp;
- dp = add (sp, NULL);
+ dp = mh_xstrdup(sp);
/* start at the end and zap trailing whitespace */
for (cp = dp + strlen (dp) - 1;