Avoid undefined behaviour when copying part of structure
* src/dispnew.c (copy_row_except_pointers): Don't use address of subobject as starting point.
This commit is contained in:
parent
4320180111
commit
6943786b5c
1 changed files with 1 additions and 1 deletions
|
@ -1034,7 +1034,7 @@ copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
|
|||
{
|
||||
enum { off = offsetof (struct glyph_row, x) };
|
||||
|
||||
memcpy (&to->x, &from->x, sizeof *to - off);
|
||||
memcpy ((char *) to + off, (char *) from + off, sizeof *to - off);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue