mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-10 21:00:55 -04:00
Re-add src == dst check in SafeStringCopyTruncate
Accidentally dropped this while iterating on the exact implementation.
This commit is contained in:
@@ -26,6 +26,10 @@ template <size_t BufSize>
|
||||
void SafeStringCopyTruncate(char (&buffer)[BufSize], const char* src) {
|
||||
static_assert(BufSize > 0, "Target buffer cannot be size zero");
|
||||
|
||||
if (buffer == src) {
|
||||
CRASH("Cannot copy string to same buffer");
|
||||
}
|
||||
|
||||
strncpyProxy(buffer, src, BufSize);
|
||||
buffer[BufSize - 1] = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user