Replace getcpy() and strdup() with mh_xstrdup()
[mmh] / uip / mhl.c
index ddf32ec..e4e8dbf 100644 (file)
--- a/uip/mhl.c
+++ b/uip/mhl.c
@@ -369,7 +369,7 @@ mhl_format(char *file, int width)
                                int n = 0;
 
                                /* split the fields */
-                               tmparray = brkstring(getcpy(++parptr), ",",
+                               tmparray = brkstring(mh_xstrdup(++parptr), ",",
                                                NULL);
                                /*
                                ** copy pointers to split fields
@@ -400,10 +400,10 @@ mhl_format(char *file, int width)
                        if (!c1->c_fstr && global.c_fstr) {
                                if ((c1->c_flags & DATEFMT) &&
                                                (global.c_flags & DATEFMT)) {
-                                       c1->c_fstr = getcpy(global.c_fstr);
+                                       c1->c_fstr = mh_xstrdup(global.c_fstr);
                                } else if ((c1->c_flags & ADDRFMT) &&
                                                (global.c_flags & ADDRFMT)) {
-                                       c1->c_fstr = getcpy(global.c_fstr);
+                                       c1->c_fstr = mh_xstrdup(global.c_fstr);
                                }
                        }
                        continue;
@@ -459,7 +459,7 @@ evalvar(struct mcomp *c1)
                cp = concat("=", cp, NULL);
                fmtstr = new_fs(cp, NULL);
                mh_free0(&cp);
-               c1->c_fstr = getcpy(fmtstr);
+               c1->c_fstr = mh_xstrdup(fmtstr);
                c1->c_flags |= FORMAT;
                return 0;
        }
@@ -468,7 +468,7 @@ evalvar(struct mcomp *c1)
                char *fmtstr;
 
                fmtstr = new_fs("=%(decode{text})", NULL);
-               c1->c_fstr = getcpy(fmtstr);
+               c1->c_fstr = mh_xstrdup(fmtstr);
                c1->c_flags |= FORMAT;
                return 0;
        }
@@ -530,7 +530,7 @@ ptos(char *name, char **s)
        }
        c = *parptr;
        *parptr = 0;
-       *s = getcpy(cp);
+       *s = mh_xstrdup(cp);
        if ((*parptr = c) == '"')
                parptr++;
        return 0;
@@ -769,7 +769,7 @@ mcomp_format(struct mcomp *c1, struct mcomp *c2)
 
                fmt_scan(c1->c_fmt, buffer, sizeof(buffer) - 1, dat);
                /* Don't need to append a newline, dctime() already did */
-               c2->c_text = getcpy(buffer);
+               c2->c_text = mh_xstrdup(buffer);
 
                mh_free0(&ap);
                return;
@@ -780,10 +780,10 @@ mcomp_format(struct mcomp *c1, struct mcomp *c2)
                p = mh_xcalloc(1, sizeof(*p));
 
                if ((mp = getm(cp, NULL, 0, AD_NAME, error)) == NULL) {
-                       p->pq_text = getcpy(cp);
-                       p->pq_error = getcpy(error);
+                       p->pq_text = mh_xstrdup(cp);
+                       p->pq_error = mh_xstrdup(error);
                } else {
-                       p->pq_text = getcpy(mp->m_text);
+                       p->pq_text = mh_xstrdup(mp->m_text);
                        mnfree(mp);
                }
                q = (q->pq_next = p);
@@ -827,12 +827,12 @@ add_queue(struct mcomp **head, struct mcomp **tail, char *name,
        c1 = mh_xcalloc(1, sizeof(*c1));
 
        c1->c_flags = flags & ~INIT;
-       if ((c1->c_name = name ? getcpy(name) : NULL))
+       if ((c1->c_name = name ? mh_xstrdup(name) : NULL))
                c1->c_flags |= mcomp_flags(c1->c_name);
-       c1->c_text = text ? getcpy(text) : NULL;
+       c1->c_text = text ? mh_xstrdup(text) : NULL;
        if (flags & INIT) {
                if (global.c_ovtxt)
-                       c1->c_ovtxt = getcpy(global.c_ovtxt);
+                       c1->c_ovtxt = mh_xstrdup(global.c_ovtxt);
                c1->c_offset = global.c_offset;
                c1->c_ovoff = global. c_ovoff;
                c1->c_width = 0;