- register int len;
- register int isgroup;
- register char *dst;
- register char *cp;
- register char *sp;
- register struct mailname *mp = NULL;
-
- /* if we don't have a buffer yet, get one */
- if (bufsiz == 0) {
- buf = malloc (BUFINCR);
- if (! buf)
- adios (NULL, "formataddr: couldn't allocate buffer space");
- last_dst = buf; /* XXX */
- bufsiz = BUFINCR - 6; /* leave some slop */
- bufend = buf + bufsiz;
- }
- /*
- * If "orig" points to our buffer we can just pick up where we
- * left off. Otherwise we have to copy orig into our buffer.
- */
- if (orig == buf)
- dst = last_dst;
- else if (!orig || !*orig) {
- dst = buf;
- *dst = '\0';
- } else {
- dst = last_dst; /* XXX */
- CHECKMEM (orig);
- CPY (orig);
- }