remove unnecessary casts
[mmh] / uip / folder.c
index 3ca0e7d..b4758cf 100644 (file)
@@ -324,21 +324,22 @@ main(int argc, char **argv)
 
        /* Allocate initial space to record folder information */
        maxFolderInfo = CRAWL_NUMFOLDERS;
-       fi = mh_xmalloc(maxFolderInfo * sizeof(*fi));
+       fi = mh_xcalloc(maxFolderInfo, sizeof(*fi));
 
        /*
        ** Scan the folders
        */
+       /*
+       ** change directory to base of nmh directory for
+       ** crawl_folders
+       */
+       if (chdir(nmhdir) == NOTOK) {
+               adios(EX_OSERR, nmhdir, "unable to change directory to");
+       }
        if (all || ftotal > 0) {
                /*
                ** If no folder is given, do them all
                */
-               /*
-               ** change directory to base of nmh directory for
-               ** crawl_folders
-               */
-               if (chdir(nmhdir) == NOTOK)
-                       adios(EX_OSERR, nmhdir, "unable to change directory to");
                if (!argfolder) {
                        if (msg)
                                admonish(NULL, "no folder given for message %s", msg);