]> diplodocus.org Git - nmh/blobdiff - sbr/addrsbr.c
mhshow/test-charset: Use octal, not hex, in printf(1) format string.
[nmh] / sbr / addrsbr.c
index a9f16d8f9dec788413b4f177706f51db8742ccb6..eadf1d07443e71a1bc3399e33b4181d3017cd0a5 100644 (file)
@@ -77,7 +77,7 @@ static char adr[BUFSIZ];
 static int eai = 0;
 
 void
-enable_eai() {
+enable_eai(void) {
     eai = 1;
 }
 
@@ -204,13 +204,13 @@ mnfree (struct mailname *mp)
     if (!mp)
        return;
 
-    mh_xfree(mp->m_text);
-    mh_xfree(mp->m_pers);
-    mh_xfree(mp->m_mbox);
-    mh_xfree(mp->m_host);
-    mh_xfree(mp->m_path);
-    mh_xfree(mp->m_gname);
-    mh_xfree(mp->m_note);
+    free(mp->m_text);
+    free(mp->m_pers);
+    free(mp->m_mbox);
+    free(mp->m_host);
+    free(mp->m_path);
+    free(mp->m_gname);
+    free(mp->m_note);
 
     free(mp);
 }
@@ -224,9 +224,7 @@ auxformat (struct mailname *mp, int extras)
 
        if (mp->m_nohost)
            strncpy (addr, FENDNULL(mp->m_mbox), sizeof(addr));
-       else
-
-       if (mp->m_type != UUCPHOST) {
+       else if (mp->m_type != UUCPHOST) {
            if (mp->m_host)
                snprintf (addr, sizeof(addr), "%s%s@%s", FENDNULL(mp->m_path),
                          FENDNULL(mp->m_mbox), mp->m_host);
@@ -247,12 +245,10 @@ auxformat (struct mailname *mp, int extras)
            snprintf (buffer, sizeof(buffer), "%s <%s>",
                    legal_person (mp->m_pers ? mp->m_pers : mp->m_mbox),
                    addr);
-    }
+    } else if (mp->m_note)
+        snprintf (buffer, sizeof(buffer), "%s %s", addr, mp->m_note);
     else
-       if (mp->m_note)
-           snprintf (buffer, sizeof(buffer), "%s %s", addr, mp->m_note);
-       else
-           strncpy (buffer, addr, sizeof(buffer));
+        strncpy (buffer, addr, sizeof(buffer));
 
     return buffer;
 }
@@ -271,7 +267,7 @@ auxformat (struct mailname *mp, int extras)
  * Check if this is my address
  */
 
-int
+bool
 ismymbox (struct mailname *np)
 {
     int oops;
@@ -298,12 +294,12 @@ ismymbox (struct mailname *np)
 
            if ((cp = getname(am)) == NULL) {
                inform("Unable to find address in local-mailbox, continuing...");
-               return 0;
+               return false;
            }
 
            if ((mq.m_next = getm (cp, NULL, 0, NULL, 0)) == NULL) {
                 inform("invalid entry in local-mailbox: %s, continuing...", cp);
-               return 0;
+               return false;
            }
 
            /* Sigh, it turns out that the address parser gets messed up
@@ -362,7 +358,7 @@ ismymbox (struct mailname *np)
     }
 
     if (np == NULL) /* XXX */
-       return 0;
+       return false;
     
     /*
      * Don't perform this "local" test if we have a Local-Mailbox set
@@ -383,7 +379,7 @@ ismymbox (struct mailname *np)
            case LOCALHOST:
 local_test: ;
                if (!strcasecmp (np->m_mbox, mq.m_mbox))
-                   return 1;
+                   return true;
                break;
 
            default:
@@ -421,7 +417,7 @@ local_test: ;
        }
 
        if (mp->m_nohost)
-           return 1;
+           return true;
        if (np->m_host == NULL || mp->m_host == NULL)
            continue;
        if ((len = strlen (cp = np->m_host))
@@ -445,8 +441,8 @@ local_test: ;
                    continue;
                break;
        }
-       return 1;
+       return true;
     }
 
-    return 0;
+    return false;
 }