]> diplodocus.org Git - nmh/blobdiff - uip/mhparse.c
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / uip / mhparse.c
index 49c1aba6f22359aceacfdcf64e7321caefbd6038..7b1352aa4a17c08ec239b65bc1903a60d9a4657e 100644 (file)
@@ -3537,8 +3537,7 @@ bad_quote:
            }
 
            if (pp == NULL) {
-               NEW(pp);
-               memset(pp, 0, sizeof(*pp));
+               NEW0(pp);
                pp->name = nameptr;
                pp->next = phead;
                phead = pp;
@@ -3548,8 +3547,7 @@ bad_quote:
             * Insert this into the section linked list
             */
 
-           NEW(sp);
-           memset(sp, 0, sizeof(*sp));
+           NEW0(sp);
            sp->value = valptr;
            sp->index = index;
            sp->len = len;
@@ -3665,7 +3663,7 @@ content_charset (CT ct) {
 
     ret_charset = get_param(ct->c_ctinfo.ci_first_pm, "charset", '?', 0);
 
-    return ret_charset ? ret_charset : getcpy ("US-ASCII");
+    return ret_charset ? ret_charset : mh_xstrdup("US-ASCII");
 }
 
 
@@ -4084,8 +4082,7 @@ add_param(PM *first, PM *last, char *name, char *value, int nocopy)
 {
     PM pm;
 
-    NEW(pm);
-    memset(pm, 0, sizeof(*pm));
+    NEW0(pm);
     pm->pm_name = nocopy ? name : getcpy(name);
     pm->pm_value = nocopy ? value : getcpy(value);