X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2f689a1cb907a5de04e6d39ffd217a69af3216c7..4548a3ecc4248a1d4bd4fdd45d9a2bb1e61d1e70:/uip/distsbr.c diff --git a/uip/distsbr.c b/uip/distsbr.c index e5f7bc55..bbaeaf51 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -2,8 +2,6 @@ /* * distsbr.c -- routines to do additional "dist-style" processing * - * $Id$ - * * 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. @@ -48,9 +46,9 @@ distout (char *drft, char *msgnam, char *backup) lseek (hdrfd, (off_t) 0, SEEK_SET); /* msgnam not accurate */ cpydata (hdrfd, fileno (ofp), msgnam, drft); - for (state = FLD, resent = NULL;;) - switch (state = - m_getfld (state, name, buffer, sizeof buffer, ifp)) { + for (state = FLD, resent = NULL;;) { + int buffersz = sizeof buffer; + switch (state = m_getfld (state, name, buffer, &buffersz, ifp)) { case FLD: case FLDPLUS: case FLDEOF: @@ -67,8 +65,8 @@ distout (char *drft, char *msgnam, char *backup) resent = add (buffer, resent); fprintf (ofp, "%s: %s", name, buffer); while (state == FLDPLUS) { - state = m_getfld (state, name, - buffer, sizeof buffer, ifp); + buffersz = sizeof buffer; + state = m_getfld (state, name, buffer, &buffersz, ifp); resent = add (buffer, resent); fputs (buffer, ofp); } @@ -101,6 +99,7 @@ distout (char *drft, char *msgnam, char *backup) default: adios (NULL, "getfld() returned %d", state); } + } process: ; fclose (ifp); fflush (ofp); @@ -153,9 +152,9 @@ ready_msg (char *msgnam) adios (NULL, "no file descriptors -- you lose big"); unlink (tmpfil); - for (state = FLD;;) - switch (state = - m_getfld (state, name, buffer, sizeof buffer, ifp)) { + for (state = FLD;;) { + int buffersz = sizeof buffer; + switch (state = m_getfld (state, name, buffer, &buffersz, ifp)) { case FLD: case FLDPLUS: case FLDEOF: @@ -163,8 +162,8 @@ ready_msg (char *msgnam) fprintf (ofp, "Prev-"); fprintf (ofp, "%s: %s", name, buffer); while (state == FLDPLUS) { - state = m_getfld (state, name, - buffer, sizeof buffer, ifp); + buffersz = sizeof buffer; + state = m_getfld (state, name, buffer, &buffersz, ifp); fputs (buffer, ofp); } if (state == FLDEOF) @@ -187,8 +186,8 @@ ready_msg (char *msgnam) unlink (tmpfil); fprintf (ofp, "\n%s", buffer); while (state == BODY) { - state = m_getfld (state, name, - buffer, sizeof buffer, ifp); + buffersz = sizeof buffer; + state = m_getfld (state, name, buffer, &buffersz, ifp); fputs (buffer, ofp); } case FILEEOF: @@ -201,6 +200,7 @@ ready_msg (char *msgnam) default: adios (NULL, "getfld() returned %d", state); } + } process: ; fclose (ifp); fclose (ofp);