Skip to content

Commit

Permalink
filter: make sure clone copies metadata
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Feb 9, 2024
1 parent f90c067 commit 4a6f19a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nostrdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ int ndb_filter_clone(struct ndb_filter *dst, struct ndb_filter *src)
{
size_t src_size, elem_size, data_size;

memcpy(dst, src, sizeof(*src));

elem_size = src->elem_buf.end - src->elem_buf.start;
data_size = src->data_buf.end - src->data_buf.start;
src_size = data_size + elem_size;
Expand Down

0 comments on commit 4a6f19a

Please sign in to comment.