vim-patch:8.2.1507: using malloc() directly

Problem:    Using malloc() directly.
Solution:   Use ALLOC_ONE().  Remove superfluous typecast.  (Hussam al-Homsi,
            closes vim/vim#6768)
51b6eb47b3
This commit is contained in:
Jan Edmund Lazo
2021-03-08 21:15:23 -05:00
parent f7f7146588
commit effd234960
2 changed files with 10 additions and 18 deletions

View File

@@ -3859,8 +3859,8 @@ static void ml_updatechunk(buf_T *buf, linenr_T line, long len, int updtype)
/* May resize here so we don't have to do it in both cases below */
if (buf->b_ml.ml_usedchunks + 1 >= buf->b_ml.ml_numchunks) {
buf->b_ml.ml_numchunks = buf->b_ml.ml_numchunks * 3 / 2;
buf->b_ml.ml_chunksize = (chunksize_T *)
xrealloc(buf->b_ml.ml_chunksize,
buf->b_ml.ml_chunksize = xrealloc(
buf->b_ml.ml_chunksize,
sizeof(chunksize_T) * buf->b_ml.ml_numchunks);
}