mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-27 00:34:46 +01:00
Move StrCatFTime into Chat.cpp, its only user
This commit is contained in:
@@ -207,6 +207,21 @@ void ChatDraw(DrawPixelInfo& dpi, ColourWithFlags chatBackgroundColor)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* strftime wrapper which appends to an existing string.
|
||||
*/
|
||||
static size_t StrCatFTime(char* buffer, size_t bufferSize, const char* format, const struct tm* tp)
|
||||
{
|
||||
size_t stringLen = strnlen(buffer, bufferSize);
|
||||
if (stringLen < bufferSize)
|
||||
{
|
||||
char* dst = buffer + stringLen;
|
||||
size_t dstMaxSize = bufferSize - stringLen;
|
||||
return strftime(dst, dstMaxSize, format, tp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ChatAddHistory(std::string_view s)
|
||||
{
|
||||
// Format a timestamp
|
||||
|
||||
Reference in New Issue
Block a user