X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6fc2909634fb431c65ecfa8b6db4f6519f99b389..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/uip/post.c diff --git a/uip/post.c b/uip/post.c index d1e58ebf..553a2258 100644 --- a/uip/post.c +++ b/uip/post.c @@ -305,7 +305,6 @@ static void fcc (char *, char *); static void die (char *, char *, ...); static void post (char *, int, int, int, char *, int, char *); static void do_text (char *file, int fd); -static int scan_input (int, int *); static void do_an_address (struct mailname *, int); static void do_addresses (int, int); static int find_prefix (void); @@ -805,8 +804,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) should never have reached this point. Warn about any that are non-empty. */ if (strcmp (str, "\n")) { - char *newline = strchr (str, '\n'); - if (newline) *newline = '\0'; + TrimSuffixC(str, '\n'); if (! whomsw) { advise (NULL, "ignoring header line -- %s: %s", name, str); } @@ -828,7 +826,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) msgflags |= (hdr->set & ~(MVIS | MINV)); if (hdr->flags & HSUB) - subject = subject ? add (str, add ("\t", subject)) : getcpy (str); + subject = subject ? add (str, add ("\t", subject)) : mh_xstrdup(str); if (hdr->flags & HFCC) { if ((cp = strrchr(str, '\n'))) *cp = 0; @@ -1219,7 +1217,7 @@ putadr (char *name, char *aka, struct mailname *mp, FILE *out, unsigned int flag } if (*aka && mp->m_type != UUCPHOST && !mp->m_pers) - mp->m_pers = getcpy (aka); + mp->m_pers = mh_xstrdup(aka); if (format) { if (mp->m_gname) { snprintf (buffer, sizeof(buffer), "%s;", mp->m_gname); @@ -1335,7 +1333,7 @@ pl (void) printf ("\n\t-- Folder Copies --\nfcc:\t"); for (i = 0; i < fccind; i++) printf ("%s%s", fccfold[i], i + 1 < fccind ? ",\n\t" : ""); - printf ("\n"); + putchar('\n'); } @@ -1391,7 +1389,7 @@ insert_fcc (struct headers *hdr, char *pp) if (fccind >= FCCS) adios (NULL, "too many %ss", hdr->value); - fccfold[fccind++] = getcpy (cp); + fccfold[fccind++] = mh_xstrdup(cp); } /* @@ -1855,27 +1853,6 @@ do_text (char *file, int fd) } -/* - * See if input has any 8-bit bytes. - */ -static int -scan_input (int fd, int *eightbit) { - int state; - char buf[BUFSIZ]; - - lseek (fd, (off_t) 0, SEEK_SET); - - while ((state = read (fd, buf, sizeof buf)) > 0) { - if (contains8bit (buf, buf + state)) { - *eightbit = 1; - return OK; - } - } - - return state == NOTOK ? NOTOK : OK; -} - - /* * SIGNAL HANDLING */