X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a9bb157da7d3cee576e8944eaf8fab2bdbc4be8d..d3d8f636ed951b4c02bdeeb146b528fe00dfbb48:/uip/mhfixmsg.c?ds=inline diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index cef8593f..2737dac8 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -11,7 +11,9 @@ #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" @@ -816,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) { @@ -835,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++; @@ -850,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 */ }