mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 06:46:07 +00:00
vim-patch:8.1.1827: allocating more memory than needed for extended structs (#22081)
Problem: Allocating more memory than needed for extended structs.
Solution: Use offsetof() instead of sizeof(). (Dominique Pelle,
closes vim/vim#4786)
47ed553fd5
This commit is contained in:
@@ -10,9 +10,9 @@
|
||||
|
||||
// Sign group
|
||||
typedef struct signgroup_S {
|
||||
uint16_t sg_refcount; // number of signs in this group
|
||||
int sg_next_sign_id; // next sign id for this group
|
||||
char sg_name[1]; // sign group name
|
||||
int sg_next_sign_id; ///< next sign id for this group
|
||||
uint16_t sg_refcount; ///< number of signs in this group
|
||||
char sg_name[1]; ///< sign group name, actually longer
|
||||
} signgroup_T;
|
||||
|
||||
// Macros to get the sign group structure from the group name
|
||||
|
Reference in New Issue
Block a user