]> diplodocus.org Git - nmh/blobdiff - sbr/context_read.c
mhbuild.man: Avoid using format-free printf(3) in example.
[nmh] / sbr / context_read.c
index a4c9820a7807f3ec5d9b158e69de70709f941f80..f899624e324d64f0999c7060bef14e88aaedb955 100644 (file)
@@ -26,6 +26,7 @@
 #include "m_maildir.h"
 #include "makedir.h"
 #include <pwd.h>                               /* structure for getpwuid() results */
+#include "h/utils.h"
 
 void
 context_read (void)
@@ -53,8 +54,7 @@ context_read (void)
     if ((mypath = getenv("HOME")) == NULL) {
        if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
            adios(NULL, "cannot determine your home directory");
-       else
-           mypath = pw->pw_dir;
+        mypath = pw->pw_dir;
     }
 
     /*
@@ -138,10 +138,10 @@ context_read (void)
        return;
     }
     
-    ctxpath = getcpy (m_maildir (cp));
+    ctxpath = mh_xstrdup(m_maildir(cp));
 
     if ((ib = lkfopendata (ctxpath, "r", &failed_to_lock))) {
-       readconfig ((struct node **) 0, ib, cp, 1);
+       readconfig(NULL, ib, cp, 1);
        lkfclosedata (ib, ctxpath);
     }
 }