X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2c9ef70f084977c3a34a64072adcb2d474aff44a..cebf14da4fc370baeba455bad0a1dc6df9532a15:/uip/replsbr.c diff --git a/uip/replsbr.c b/uip/replsbr.c index 3dbc3031..dc3c4f8c 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -132,7 +132,8 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, * pick any interesting stuff out of msg "inb" */ for (state = FLD;;) { - state = m_getfld (state, name, tmpbuf, sizeof(tmpbuf), inb); + int msg_count = sizeof tmpbuf; + state = m_getfld (state, name, tmpbuf, &msg_count, inb); switch (state) { case FLD: case FLDPLUS: @@ -147,15 +148,17 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, if (i != -1) { char_read += msg_count; while (state == FLDPLUS) { - state = m_getfld(state, name, tmpbuf, - sizeof(tmpbuf), inb); + msg_count= sizeof tmpbuf; + state = m_getfld(state, name, tmpbuf, &msg_count, inb); fmt_appendcomp(i, name, tmpbuf); char_read += msg_count; } } - while (state == FLDPLUS) - state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb); + while (state == FLDPLUS) { + msg_count= sizeof tmpbuf; + state = m_getfld (state, name, tmpbuf, &msg_count, inb); + } break; case LENERR: