X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/7fd676d57355fd26c1127a79d9ba805973928316..4548a3ecc4248a1d4:/uip/whatnowsbr.c diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 38905372..a56446f8 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -941,8 +941,9 @@ check_draft (char *msgnam) if ((fp = fopen (msgnam, "r")) == NULL) return 0; - for (state = FLD;;) - switch (state = m_getfld (state, name, buf, sizeof(buf), fp)) { + for (state = FLD;;) { + int bufsz = sizeof buf; + switch (state = m_getfld (state, name, buf, &bufsz, fp)) { case FLD: case FLDPLUS: case FLDEOF: @@ -955,8 +956,10 @@ check_draft (char *msgnam) fclose (fp); return 0; } - while (state == FLDPLUS) - state = m_getfld (state, name, buf, sizeof(buf), fp); + while (state == FLDPLUS) { + bufsz = sizeof buf; + state = m_getfld (state, name, buf, &bufsz, fp); + } break; case BODY: @@ -969,7 +972,8 @@ check_draft (char *msgnam) return 1; } - state = m_getfld (state, name, buf, sizeof(buf), fp); + bufsz = sizeof buf; + state = m_getfld (state, name, buf, &bufsz, fp); } while (state == BODY); /* and fall... */ @@ -977,6 +981,7 @@ check_draft (char *msgnam) fclose (fp); return 0; } + } }