X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a30ef3465250ae21bb3928a6e120ba4351cf8ff0..0d0d0e65a4c093f3f8827d4cd3375dcde4d4aab0:/uip/mhfixmsg.c diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 549cffe9..2737dac8 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -6,13 +6,17 @@ */ #include +#include #include #include #include #include +#include "../sbr/m_maildir.h" #include "../sbr/m_mktemp.h" +#include "../sbr/mime_type.h" #include "mhfree.h" #include "mhoutsbr.h" +#include "mhshowsbr.h" #include #define MHFIXMSG_SWITCHES \ @@ -814,7 +818,7 @@ replace_boundary (CT ct, char *file, char *boundary) { int compnum, state; char buf[NMH_BUFSIZ], name[NAMESZ]; char *np, *vp; - m_getfld_state_t gstate = 0; + m_getfld_state_t gstate; int status = OK; if (ct->c_file == NULL) { @@ -833,10 +837,11 @@ replace_boundary (CT ct, char *file, char *boundary) { return NOTOK; } + gstate = m_getfld_state_init(fpin); for (compnum = 1;;) { int bufsz = (int) sizeof buf; - switch (state = m_getfld (&gstate, name, buf, &bufsz, fpin)) { + switch (state = m_getfld2(&gstate, name, buf, &bufsz)) { case FLD: case FLDPLUS: compnum++; @@ -848,7 +853,7 @@ replace_boundary (CT ct, char *file, char *boundary) { /* if necessary, get rest of field */ while (state == FLDPLUS) { bufsz = sizeof buf; - state = m_getfld (&gstate, name, buf, &bufsz, fpin); + state = m_getfld2(&gstate, name, buf, &bufsz); vp = add (buf, vp); /* add to previous value */ }