Skip to content

Commit

Permalink
Fix destination offset in Vec_Append when element_size > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Nov 26, 2024
1 parent d599748 commit a698b73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void Vec_Append (void **pvec, size_t element_size, const void *data, size_t coun
if (!count)
return;
Vec_Grow (pvec, element_size, count);
memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size, data, count * element_size);
memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size * element_size, data, count * element_size);
VEC_HEADER(*pvec).size += count;
}

Expand Down

2 comments on commit a698b73

@andrei-drexler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sezero QS has the same bug (never triggered, though).

@sezero
Copy link

@sezero sezero commented on a698b73 Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied. Thanks!

Please sign in to comment.