]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_addr.c
Add basic support for the STLS command in POP
[nmh] / sbr / fmt_addr.c
index 07c0cecfdf16213513409119d7d48ed9e5d6a458..6d58061920f8ced75f96b39ecdb477428bc34314 100644 (file)
@@ -1,16 +1,15 @@
-
-/*
- * fmt_addr.c -- format an address field (from fmt_scan)
+/* fmt_addr.c -- format an address field (from fmt_scan)
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/addrsbr.h>
-#include <h/fmt_scan.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "fmt_addr.h"
+#include "h/addrsbr.h"
+#include "h/fmt_scan.h"
+#include "h/utils.h"
 
 static char *buf;              /* our current working buffer  */
 static char *bufend;           /* end of working buffer       */
@@ -51,12 +50,12 @@ static unsigned int bufsiz; /* current size of buf         */
 char *
 formataddr (char *orig, char *str)
 {
-    register int len;
-    register int isgroup;
-    register char *dst;
-    register char *cp;
-    register char *sp;
-    register struct mailname *mp = NULL;
+    int len;
+    bool isgroup;
+    char *dst;
+    char *cp;
+    char *sp;
+    struct mailname *mp = NULL;
 
     /* if we don't have a buffer yet, get one */
     if (bufsiz == 0) {
@@ -81,13 +80,13 @@ formataddr (char *orig, char *str)
     }
 
     /* concatenate all the new addresses onto 'buf' */
-    for (isgroup = 0; (cp = getname (str)); ) {
+    for (isgroup = false; (cp = getname (str)); ) {
        if ((mp = getm (cp, NULL, 0, NULL, 0)) == NULL)
            continue;
 
        if (isgroup && (mp->m_gname || !mp->m_ingrp)) {
            *dst++ = ';';
-           isgroup = 0;
+           isgroup = false;
        }
        /* if we get here we're going to add an address */
        if (dst != buf) {
@@ -97,7 +96,7 @@ formataddr (char *orig, char *str)
        if (mp->m_gname) {
            CHECKMEM (mp->m_gname);
            CPY (mp->m_gname);
-           isgroup++;
+           isgroup = true;
        }
        sp = adrformat (mp);
        CHECKMEM (sp);
@@ -110,10 +109,11 @@ formataddr (char *orig, char *str)
 
     *dst = '\0';
     last_dst = dst;
-    return (buf);
+    return buf;
 }
 
-char *concataddr (char *orig, char *str)
+char *
+concataddr (char *orig, char *str)
 {
     return formataddr(orig, str);
 }