summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-26 21:50:09 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-26 21:50:09 +0100
commit6d5485b97cd46f81512e9198ac7c59c7ba1d9247 (patch)
tree3c931ba16f545cfaf610e56d3d66af2a9b1146ae
parent62ae3df3f3ee7b82a539391b0b3ce17ac3cee4ce (diff)
Potentially overlapping areas need memmove, not memcpy
-rw-r--r--ot_stats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ot_stats.c b/ot_stats.c
index bee1f93..53bd749 100644
--- a/ot_stats.c
+++ b/ot_stats.c
@@ -175,8 +175,8 @@ static size_t stats_get_highscore_networks(stats_network_node *node, int depth,
175 ++j; 175 ++j;
176 --j; 176 --j;
177 177
178 memcpy(scores, scores + 1, j * sizeof(*scores)); 178 memmove(scores, scores + 1, j * sizeof(*scores));
179 memcpy(networks, networks + 1, j * sizeof(*networks)); 179 memmove(networks, networks + 1, j * sizeof(*networks));
180 scores[j] = node_score; 180 scores[j] = node_score;
181 memcpy(networks + j, node_value, sizeof(*networks)); 181 memcpy(networks + j, node_value, sizeof(*networks));
182 } 182 }