1
0
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:
Aaron van Geffen
2024-12-11 16:49:06 +01:00
parent 4f32028e01
commit ed6611219d
3 changed files with 15 additions and 20 deletions

View File

@@ -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