0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.1560: using NULL pointers in some code

Problem:    Using NULL pointers in some code. (James McCoy)
Solution:   Avoid adding to a NULL pointer.  Use byte as unsigned.
This commit is contained in:
Bram Moolenaar
2020-09-01 19:56:15 +02:00
parent ca563b9b94
commit 9c2b06637b
6 changed files with 26 additions and 14 deletions

View File

@@ -816,7 +816,7 @@ read_cnt_string(FILE *fd, int cnt_bytes, int *cntp)
// read the length bytes, MSB first
for (i = 0; i < cnt_bytes; ++i)
cnt = (cnt << 8) + getc(fd);
cnt = (cnt << 8) + (unsigned)getc(fd);
if (cnt < 0)
{
*cntp = SP_TRUNCERROR;