X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/485fa064f8388272fe00ebfd29e4babf6dfed019..6aec307fcced3dbd5dc47c52c79bd5c833021f51:/uip/mhparse.c?ds=sidebyside diff --git a/uip/mhparse.c b/uip/mhparse.c index 76dd7f71..74e03a7e 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -295,7 +295,7 @@ get_content (FILE *in, char *file, int toplevel) char *np, *vp; CT ct; HF hp; - m_getfld_state_t gstate = 0; + m_getfld_state_t gstate; /* allocate the content structure */ NEW0(ct); @@ -307,10 +307,11 @@ get_content (FILE *in, char *file, int toplevel) * Parse the header fields for this * content into a linked list. */ - m_getfld_track_filepos (&gstate, in); + gstate = m_getfld_state_init(in); + m_getfld_track_filepos2(&gstate); for (compnum = 1;;) { int bufsz = sizeof buf; - switch (state = m_getfld (&gstate, name, buf, &bufsz, in)) { + switch (state = m_getfld2(&gstate, name, buf, &bufsz)) { case FLD: case FLDPLUS: compnum++; @@ -322,7 +323,7 @@ get_content (FILE *in, char *file, int toplevel) /* if necessary, get rest of field */ while (state == FLDPLUS) { bufsz = sizeof buf; - state = m_getfld (&gstate, name, buf, &bufsz, in); + state = m_getfld2(&gstate, name, buf, &bufsz); vp = add (buf, vp); /* add to previous value */ }