pager history: fix bufsize calculation

bufsize was bigger than the actual allocated memory

Fixes: b9e6557f729f ("Allow arbitrary sized lines in the secondary scrollback buffer")
This commit is contained in:
Dominique Martinet 2018-11-30 16:04:46 +09:00
parent 60de840d69
commit 3a6bc94d25

View File

@ -73,7 +73,7 @@ pagerhist_extend(PagerHistoryBuf *ph, size_t minsz) {
void *newbuf = PyMem_Realloc(ph->buffer, newsz * sizeof(Py_UCS4));
if (!newbuf) return false;
ph->buffer = newbuf;
ph->bufsize += newsz;
ph->bufsize = newsz;
return true;
}