diff options
| author | Simon Tatham <anakin@pobox.com> | 2023-04-20 13:52:13 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2023-04-20 17:21:54 +0100 |
| commit | 11a8149d673d96bec17d6487b5fa95b5bf5ffd6b (patch) | |
| tree | 8087f57805f3cc7f981bffcee9fecebd9e806610 /signpost.c | |
| parent | bb561ee3b18be69e52b17cedde50eac96ea409da (diff) | |
| download | puzzles-11a8149d673d96bec17d6487b5fa95b5bf5ffd6b.zip puzzles-11a8149d673d96bec17d6487b5fa95b5bf5ffd6b.tar.gz puzzles-11a8149d673d96bec17d6487b5fa95b5bf5ffd6b.tar.bz2 puzzles-11a8149d673d96bec17d6487b5fa95b5bf5ffd6b.tar.xz | |
Use a dedicated copy function to copy dsfs.
Previously we were duplicating the contents of a dsf using straight-up
memcpy. Now there's a dsf_copy function wrapping the same memcpy.
For the moment, this still has to take a size parameter, because the
size isn't stored inside the dsf itself. But once we make a proper
data type, it will be.
Diffstat (limited to 'signpost.c')
| -rw-r--r-- | signpost.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -482,7 +482,7 @@ static void dup_game_to(game_state *to, const game_state *from) memcpy(to->next, from->next, to->n*sizeof(int)); memcpy(to->prev, from->prev, to->n*sizeof(int)); - memcpy(to->dsf, from->dsf, to->n*sizeof(int)); + dsf_copy(to->dsf, from->dsf, to->n); memcpy(to->numsi, from->numsi, (to->n+1)*sizeof(int)); } |