comparison src/fold.c @ 22023:67d3826948ad v8.2.1561

patch 8.2.1561: using NULL pointers in fold code Commit: https://github.com/vim/vim/commit/81fcb67fb32a12414512b72e691a1bbbff9f8511 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 1 21:21:24 2020 +0200 patch 8.2.1561: using NULL pointers in fold code Problem: Using NULL pointers in fold code. Solution: Avoid using a NULL pointer. (Dominique Pell?, closes https://github.com/vim/vim/issues/6831, closes #6831)
author Bram Moolenaar <Bram@vim.org>
date Tue, 01 Sep 2020 21:30:04 +0200
parents 514d622473af
children 86696c617f70
comparison
equal deleted inserted replaced
22022:b692415fc88b 22023:67d3826948ad
3057 foldRemove(&fp->fd_nested, end - fp->fd_top, MAXLNUM); 3057 foldRemove(&fp->fd_nested, end - fp->fd_top, MAXLNUM);
3058 fp->fd_len = end - fp->fd_top; 3058 fp->fd_len = end - fp->fd_top;
3059 } 3059 }
3060 3060
3061 #define fold_end(fp) ((fp)->fd_top + (fp)->fd_len - 1) 3061 #define fold_end(fp) ((fp)->fd_top + (fp)->fd_len - 1)
3062 #define valid_fold(fp, gap) ((fp) < ((fold_T *)(gap)->ga_data + (gap)->ga_len)) 3062 #define valid_fold(fp, gap) ((gap)->ga_len > 0 && (fp) < ((fold_T *)(gap)->ga_data + (gap)->ga_len))
3063 #define fold_index(fp, gap) ((size_t)(fp - ((fold_T *)(gap)->ga_data))) 3063 #define fold_index(fp, gap) ((size_t)(fp - ((fold_T *)(gap)->ga_data)))
3064 3064
3065 void 3065 void
3066 foldMoveRange(garray_T *gap, linenr_T line1, linenr_T line2, linenr_T dest) 3066 foldMoveRange(garray_T *gap, linenr_T line1, linenr_T line2, linenr_T dest)
3067 { 3067 {