From 6b922eea4a33afc771b30b61b8c1926361b5cb6e Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 7 Jan 2023 15:42:07 +0100 Subject: [PATCH] Remove unused safe_strtrunc() --- src/openrct2/util/Util.cpp | 26 -------------------------- src/openrct2/util/Util.h | 1 - 2 files changed, 27 deletions(-) diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index f2c53d0432..d5ec2a125f 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -266,32 +266,6 @@ int32_t strlogicalcmp(const char* s1, const char* s2) } } -utf8* safe_strtrunc(utf8* text, size_t size) -{ - assert(text != nullptr); - - if (size == 0) - return text; - - const char* sourceLimit = text + size - 1; - char* ch = text; - char* last = text; - while (utf8_get_next(ch, const_cast(&ch)) != 0) - { - if (ch <= sourceLimit) - { - last = ch; - } - else - { - break; - } - } - *last = 0; - - return text; -} - char* safe_strcpy(char* destination, const char* source, size_t size) { assert(destination != nullptr); diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index d16fa69caf..2c6d4a8272 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -32,7 +32,6 @@ void bitcount_init(); int32_t bitcount(uint32_t source); int32_t strcicmp(char const* a, char const* b); int32_t strlogicalcmp(char const* a, char const* b); -utf8* safe_strtrunc(utf8* text, size_t size); char* safe_strcpy(char* destination, const char* source, size_t num); char* safe_strcat(char* destination, const char* source, size_t size); #if defined(_WIN32)