Use the same mh_hostname() function from test/common.h in mhsign(1)
[mmh] / sbr / folder_delmsgs.c
index 17b99be..3165883 100644 (file)
@@ -6,6 +6,8 @@
 ** complete copyright information.
 */
 
+#include <sysexits.h>
+#include <unistd.h>
 #include <h/mh.h>
 
 /*
@@ -26,7 +28,6 @@ folder_delmsgs(struct msgs *mp, int hook)
 
                /* unselect message */
                unset_selected(mp, msgnum);
-               mp->numsel--;
 
                snprintf(msgpath, sizeof (msgpath), "%s/%d",
                                mp->foldpath, msgnum);
@@ -50,7 +51,7 @@ folder_delmsgs(struct msgs *mp, int hook)
 
        /* Sanity check */
        if (mp->numsel != 0)
-               adios(NULL, "oops, mp->numsel should be 0");
+               adios(EX_SOFTWARE, NULL, "oops, mp->numsel should be 0");
 
        /* Mark that the sequence information has changed */
        mp->msgflags |= SEQMOD;