X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5ccbd49adba7e6d48f4094fa6eade7a7fb8ec4cf..21bfba3bf56e7ffd094d258803fc8f6e10a311b7:/uip/msh.c diff --git a/uip/msh.c b/uip/msh.c index 03584f6d..cc2d5efb 100644 --- a/uip/msh.c +++ b/uip/msh.c @@ -235,10 +235,10 @@ main (int argc, char **argv) case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 1); - done (1); + done (0); case VERSIONSW: print_version(invo_name); - done (1); + done (0); case IDSW: if (!(cp = *argp++) || *cp == '-') @@ -1005,15 +1005,16 @@ readid (int msgnum) return Msgs[msgnum].m_bboard_id; zp = msh_ready (msgnum, 0); - for (state = FLD;;) - switch (state = m_getfld (state, name, buf, sizeof(buf), zp)) { + for (state = FLD;;) { + int bufsz = sizeof buf; + switch (state = m_getfld (state, name, buf, &bufsz, zp)) { case FLD: - case FLDEOF: case FLDPLUS: if (!mh_strcasecmp (name, BBoard_ID)) { bp = getcpy (buf); while (state == FLDPLUS) { - state = m_getfld (state, name, buf, sizeof(buf), zp); + bufsz = sizeof buf; + state = m_getfld (state, name, buf, &bufsz, zp); bp = add (buf, bp); } i = atoi (bp); @@ -1024,13 +1025,14 @@ readid (int msgnum) continue; } while (state == FLDPLUS) - state = m_getfld (state, name, buf, sizeof(buf), zp); - if (state != FLDEOF) - continue; + bufsz = sizeof buf; + state = m_getfld (state, name, buf, &bufsz, zp); + continue; default: return 0; } + } }