]> diplodocus.org Git - nmh/blobdiff - sbr/addrsbr.c
Oops, fc31cece had a syntax error that gcc ignored, clang doesn't.
[nmh] / sbr / addrsbr.c
index 3b57f20cc4a19e54949b732dad9768f1a45ba2fc..70ddb8db0d3e3481f3fbee01fd3457efaadc10d0 100644 (file)
@@ -76,17 +76,22 @@ static char *grp = NULL;
 static char *note = NULL;
 static char err[BUFSIZ];
 static char adr[BUFSIZ];
+static int eai = 0;
+
+void
+enable_eai() {
+    eai = 1;
+}
 
 
 char *
 getname (const char *addrs)
 {
     struct adrx *ap;
-    const char *const eai = context_find ("eai");
     pers = mbox = host = route = grp = note = NULL;
     err[0] = '\0';
 
-    if ((ap = getadrx (addrs ? addrs : "", eai && strncasecmp (eai, "8bit", 4) == 0)) == NULL) {
+    if ((ap = getadrx (addrs ? addrs : "", eai)) == NULL) {
        return NULL;
     }
 
@@ -140,16 +145,7 @@ getm (char *str, char *dfhost, int dftype, char *eresult, size_t eresultsize)
        dftype = LOCALHOST;
     }
 
-    mp = (struct mailname *) mh_xcalloc ((size_t) 1, sizeof(*mp));
-    if (mp == NULL) {
-       if (eresult) {
-           strncpy (eresult, "insufficient memory to represent address",
-                    eresultsize);
-           eresult[eresultsize - 1] = '\0';
-       }
-       return NULL;
-    }
-
+    NEW0(mp);
     mp->m_next = NULL;
     mp->m_text = getcpy (str);
     if (pers)