]> diplodocus.org Git - nmh/blobdiff - sbr/trimcpy.c
NEWS: Encourage nmh-announce subscription. Capitalise `Gmail'.
[nmh] / sbr / trimcpy.c
index 50e7142e08aec696348e2135109d49d4249a2929..09b6ec34749fad779f03af31c3536a7395e0bc72 100644 (file)
@@ -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.
  *
@@ -9,8 +7,9 @@
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "trimcpy.h"
+#include "h/utils.h"
 
 
 char *
@@ -51,14 +50,15 @@ trimcpy (char *cp)
  * complete copyright information.
  */
 char *
-cpytrim (const char *sp) {
+cpytrim (const char *sp)
+{
     char *dp;
     char *cp;
 
     /* 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;
@@ -83,7 +83,8 @@ cpytrim (const char *sp) {
  * complete copyright information.
  */
 char *
-rtrim (char *sp) {
+rtrim (char *sp)
+{
     char *cp;
 
     /* start at the end and zap trailing whitespace */