From 0b05e9827bc679f6c069c9cca4e76159bbf6a90d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sun, 13 Oct 2024 21:58:44 +0300 Subject: [PATCH] BAN: Use memmove instead of memcpy on overlapping data I was accidentally using memcpy where memmove was needed --- BAN/include/BAN/String.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BAN/include/BAN/String.h b/BAN/include/BAN/String.h index b06b1aa2..df42d242 100644 --- a/BAN/include/BAN/String.h +++ b/BAN/include/BAN/String.h @@ -127,7 +127,7 @@ namespace BAN void remove(size_type index) { ASSERT(index < m_size); - memcpy(data() + index, data() + index + 1, m_size - index); + memmove(data() + index, data() + index + 1, m_size - index); m_size--; data()[m_size] = '\0'; }