X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/79db7961dc654024722449ba51c3b580086eb1a0..b63aeb3f0b2d2924480f6d2b4d50fe08b1f3de21:/sbr/m_getfld.c diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index f84d2933..f19f7f11 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -635,7 +635,13 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, if (c != EOF) c = Peek (s); if (max < n) { - /* the dest buffer is full */ + /* The dest buffer is full. Need to back the read + pointer up by one because when m_getfld() is + reentered, it will read a character. Then + we'll jump right to the FLDPLUS handling code, + which will not store that character, but + instead move on to the next one. */ + if (s->readpos > s->msg_buf) --s->readpos; s->state = FLDPLUS; finished = 1; } else if (c != ' ' && c != '\t') {