]> diplodocus.org Git - nmh/blobdiff - uip/fmttest.c
Alter HasSuffixC()'s char * to be const.
[nmh] / uip / fmttest.c
index 0b32a0412b1199e0610d4c31ce704d57d49773d2..7d08438bf1f62f3704fae6139d0b42611f9227a1 100644 (file)
@@ -434,15 +434,13 @@ process_addresses(struct format *fmt, struct msgs_array *addrs,
        for (p = pq.pq_next; p; p = q) {
            c = fmt_findcomp("text");
            if (c) {
-               if (c->c_text)
-                   free(c->c_text);
+                mh_xfree(c->c_text);
                c->c_text = p->pq_text;
                p->pq_text = NULL;
            }
            c = fmt_findcomp("error");
            if (c) {
-               if (c->c_text)
-                   free(c->c_text);
+                mh_xfree(c->c_text);
                c->c_text = p->pq_error;
                p->pq_error = NULL;
            }
@@ -451,10 +449,8 @@ process_addresses(struct format *fmt, struct msgs_array *addrs,
            fputs(charstring_buffer(buffer), stdout);
            mlistfree();
 
-           if (p->pq_text)
-               free(p->pq_text);
-           if (p->pq_error)
-               free(p->pq_error);
+            mh_xfree(p->pq_text);
+            mh_xfree(p->pq_error);
            q = p->pq_next;
            free(p);
        }
@@ -535,8 +531,7 @@ process_messages(struct format *fmt, struct msgs_array *comps,
                ivector_push_back (seqnum, seq_getnum(mp, *ap));
                
            num_unseen_seq = i;
-           if (dp)
-               free(dp);
+            mh_xfree(dp);
        }
     }
 
@@ -671,8 +666,7 @@ finished:
        for (i = 0; i < comps->size; i += 2) {
            c = fmt_findcomp(comps->msgs[i]);
            if (c) {
-               if (c->c_text)
-                   free(c->c_text);
+                mh_xfree(c->c_text);
                c->c_text = getcpy(comps->msgs[i + 1]);
            }
        }
@@ -706,8 +700,7 @@ process_raw(struct format *fmt, struct msgs_array *text, charstring_t buffer,
 
     for (i = 0; i < text->size; i++) {
        if (c != NULL) {
-           if (c->c_text != NULL)
-               free(c->c_text);
+            mh_xfree(c->c_text);
            c->c_text = getcpy(text->msgs[i]);
        }