Skip to content
Snippets Groups Projects
Commit d1647590 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy Committed by Kirill Yukhin
Browse files

fk: fix wrong sizeof() in fk_constraint_def_sizeof()

The function returns a number of bytes needed to store
an fk_constraint_def object with its name and links.
However it used sizeof(struct fk_constraint) instead
of sizeof(struct fk_constraint_def) to calculate
base object size. This worked only because
fk_constraint is bigger than fk_constraint_def.
parent df4c69ec
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ struct fk_constraint {
static inline size_t
fk_constraint_def_sizeof(uint32_t link_count, uint32_t name_len)
{
return sizeof(struct fk_constraint) +
return sizeof(struct fk_constraint_def) +
link_count * sizeof(struct field_link) +
name_len + 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment