X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/ea0a6d8112a918809bd03d8126411040d22f2bb8..b46d49ba:/sbr/trimcpy.c?ds=sidebyside diff --git a/sbr/trimcpy.c b/sbr/trimcpy.c index 7a2ac03a..625c26c0 100644 --- a/sbr/trimcpy.c +++ b/sbr/trimcpy.c @@ -1,6 +1,4 @@ - -/* - * trimcpy.c -- strip leading and trailing whitespace, +/* trimcpy.c -- strip leading and trailing whitespace, * -- replace internal whitespace with spaces, * -- then return a copy. * @@ -37,7 +35,7 @@ trimcpy (char *cp) } /* now return a copy */ - return getcpy(cp); + return mh_xstrdup(cp); } @@ -58,7 +56,7 @@ cpytrim (const char *sp) { /* 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;