Skip to content

Commit

Permalink
maple/board.c: brh_load() & brh_save(): Fix using memcpy() to m…
Browse files Browse the repository at this point in the history
…ove data between possibly overlapping ranges; should have used `memmove()`. [ref: bc67fbb]
  • Loading branch information
IepIweidieng committed Dec 9, 2019
1 parent f810d4c commit 2f64941
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maple/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ brh_load(void)

n = n * sizeof(time_t) + sizeof(BRH);
if (base != head)
memcpy(base, head, n);
memmove(base, head, n);
base = (int *) ((char *) base + n);
}
head += size;
Expand Down Expand Up @@ -689,7 +689,7 @@ brh_save(void)
if (bhno >= 0 && !(bits[bhno] & BRD_Z_BIT))
{
if (base != head)
memcpy(base, head, size);
memmove(base, head, size);
base = (int *) ((char *) base + size);
}
head = (int *) ((char *) head + size);
Expand Down

0 comments on commit 2f64941

Please sign in to comment.