X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4a78cbcd4fa986d9c1e7bd0a5a4bdb619faeb7cb..95e4dc65116ec40ae1d4f2ea41f923e65bf60e72:/uip/distsbr.c diff --git a/uip/distsbr.c b/uip/distsbr.c index d371ec1d..6fc77372 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -1,6 +1,4 @@ - -/* - * distsbr.c -- routines to do additional "dist-style" processing +/* distsbr.c -- routines to do additional "dist-style" processing * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for @@ -30,7 +28,7 @@ distout (char *drft, char *msgnam, char *backup) int state; char *dp, *resent; char name[NAMESZ], buffer[BUFSIZ]; - register FILE *ifp, *ofp; + FILE *ifp, *ofp; m_getfld_state_t gstate = 0; if (rename (drft, strcpy (backup, m_backup (drft))) == NOTOK) @@ -56,7 +54,7 @@ distout (char *drft, char *msgnam, char *backup) if (uprf (name, "distribution-")) snprintf (name, sizeof(name), "%s%s", "Resent", &name[12]); if (!uprf (name, "resent")) { - advise (NULL, BADHDR, "draft", name); + inform(BADHDR, "draft", name); goto leave_bad; } if (state == FLD) @@ -74,7 +72,7 @@ distout (char *drft, char *msgnam, char *backup) case BODY: for (dp = buffer; *dp; dp++) if (!isspace ((unsigned char) *dp)) { - advise (NULL, BADTXT, "draft"); + inform(BADTXT, "draft"); goto leave_bad; } @@ -83,11 +81,11 @@ distout (char *drft, char *msgnam, char *backup) case LENERR: case FMTERR: - advise (NULL, BADRFT, "draft"); + inform(BADRFT, "draft"); leave_bad: ; fclose (ifp); fclose (ofp); - unlink (drft); + (void) m_unlink (drft); if (rename (backup, drft) == NOTOK) adios (drft, "unable to rename %s to", backup); return NOTOK; @@ -102,9 +100,9 @@ process: ; fflush (ofp); if (!resent) { - advise (NULL, BADMSG, "draft"); + inform(BADMSG, "draft"); fclose (ofp); - unlink (drft); + (void) m_unlink (drft); if (rename (backup, drft) == NOTOK) adios (drft, "unable to rename %s to", backup); return NOTOK; @@ -127,7 +125,7 @@ ready_msg (char *msgnam) { int state, out; char name[NAMESZ], buffer[BUFSIZ], tmpfil[BUFSIZ]; - register FILE *ifp, *ofp; + FILE *ifp, *ofp; char *cp = NULL; m_getfld_state_t gstate = 0; @@ -147,7 +145,7 @@ ready_msg (char *msgnam) if ((out = dup (hdrfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) adios (NULL, "no file descriptors -- you lose big"); - unlink (tmpfil); + (void) m_unlink (tmpfil); for (;;) { int buffersz = sizeof buffer; @@ -177,7 +175,7 @@ ready_msg (char *msgnam) if ((out = dup (txtfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) adios (NULL, "no file descriptors -- you lose big"); - unlink (tmpfil); + (void) m_unlink (tmpfil); fprintf (ofp, "\n%s", buffer); while (state == BODY) { buffersz = sizeof buffer;