diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-01 13:11:15 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-01 13:11:15 +0000 |
commit | 1b438a8228a415720efb5ca1c0503f5467292e8e (patch) | |
tree | c0594ccd7e5f15daebb599474a87d5cd394a2652 /src/spellfile.c | |
parent | a7d36b732070944aab614944075ec0b409311482 (diff) | |
download | vim-git-1b438a8228a415720efb5ca1c0503f5467292e8e.tar.gz |
patch 9.0.1271: using sizeof() and subtract array size is trickyv9.0.1271
Problem: Using sizeof() and subtract array size is tricky.
Solution: Use offsetof() instead. (closes #11926)
Diffstat (limited to 'src/spellfile.c')
-rw-r--r-- | src/spellfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/spellfile.c b/src/spellfile.c index 710e4388f..bf51f5fd6 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -4305,7 +4305,7 @@ getroom( bl = NULL; else // Allocate a block of memory. It is not freed until much later. - bl = alloc_clear(sizeof(sblock_T) + SBLOCKSIZE); + bl = alloc_clear(offsetof(sblock_T, sb_data) + SBLOCKSIZE + 1); if (bl == NULL) { if (!spin->si_did_emsg) |