mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-09 20:10:37 -04:00
SafeStringCopy log fix (#1858)
* Fix logging on SafeStringCopy overflow failure * Fix CRASH() macro to not take varargs Didn't work, probably a remnant of a different iteration I made. * Fix ValidateChannel CRASH call --------- Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
committed by
GitHub
parent
e7e04b7c15
commit
e70fef0650
+2
-2
@@ -45,10 +45,10 @@ void SafeStringCopy(char* buffer, size_t bufSize, const char* src) {
|
||||
const auto srcSize = strlen(src);
|
||||
if (srcSize > bufSize - 1) [[unlikely]] {
|
||||
const auto msg = fmt::format(
|
||||
"Destination buffer too small! Need %d, have %d",
|
||||
"Destination buffer too small! Need {}, have {}",
|
||||
srcSize + 1,
|
||||
bufSize);
|
||||
CRASH("%s", msg.c_str());
|
||||
CRASH(msg.c_str());
|
||||
}
|
||||
|
||||
strncpyProxy(buffer, src, bufSize);
|
||||
|
||||
Reference in New Issue
Block a user