]> diplodocus.org Git - nmh/blobdiff - uip/refile.c
Fixed removal of <> in test-dist and test-rcvdist.
[nmh] / uip / refile.c
index 8a4392b77b37e154b0ef9c534ce3dd116c1a4fac..3afd0d6d8cb1bae8ae7b54477e1c8bba02e16058 100644 (file)
@@ -11,8 +11,6 @@
 #include <h/mh.h>
 #include <h/utils.h>
 #include <fcntl.h>
-#include <errno.h>
-#include <assert.h>
 
 #define REFILE_SWITCHES \
     X("draft", 0, DRAFTSW) \
@@ -386,11 +384,13 @@ static void
 copy_seqs (struct msgs *oldmp, int oldmsgnum, struct msgs *newmp, int newmsgnum)
 {
     char **seq;
-    int seqnum;
+    size_t seqnum;
 
-    for (seq = oldmp->msgattrs, seqnum = 0; *seq; ++seq, ++seqnum) {
+    for (seq = svector_strs (oldmp->msgattrs), seqnum = 0;
+        *seq && seqnum < svector_size (oldmp->msgattrs);
+        ++seq, ++seqnum) {
        if (strcmp (current, *seq)) {
-           assert (seqnum == seq_getnum (oldmp, *seq));
+           assert ((int) seqnum == seq_getnum (oldmp, *seq));
            if (in_sequence (oldmp, seqnum, oldmsgnum)) {
                seq_addmsg (newmp, *seq, newmsgnum,
                            is_seq_private (oldmp, seqnum) ? 0 : 1, 0);