fix oldstyle whom
authorPhilipp Takacs <philipp@bureaucracy.de>
Wed, 8 Mar 2017 14:31:37 +0000 (15:31 +0100)
committerPhilipp Takacs <philipp@bureaucracy.de>
Wed, 8 Mar 2017 14:31:37 +0000 (15:31 +0100)
Check if msg struct have selected messages before
accessing a message.

sbr/parse_msgs.c

index f42bd80..9d70cdd 100644 (file)
@@ -36,7 +36,7 @@ parse_msgs(const struct msgs_array *msgs, char *folder, struct msgs_array *files
                }
        }
 
                }
        }
 
-       for (i = f->lowsel; i <= f->hghsel; i++) {
+       for (i = f->lowsel; f->numsel > 0 && i <= f->hghsel; i++) {
                if (is_selected(f, i)) {
                        msgnam = mh_xstrdup(path);
                        msgnam = add(m_name(i), msgnam);
                if (is_selected(f, i)) {
                        msgnam = mh_xstrdup(path);
                        msgnam = add(m_name(i), msgnam);