MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / appendFormat

Function appendFormat

src/openrct2/core/String.cpp:372–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370 }
371
372 utf8* appendFormat(utf8* buffer, size_t bufferSize, const utf8* format, ...)
373 {
374 utf8* dst = buffer;
375 size_t i;
376 for (i = 0; i < bufferSize; i++)
377 {
378 if (*dst == '\0')
379 break;
380 dst++;
381 }
382
383 if (i < bufferSize - 1)
384 {
385 va_list args;
386 va_start(args, format);
387 vsnprintf(dst, bufferSize - i - 1, format, args);
388 va_end(args);
389
390 // Terminate buffer in case formatted string overflowed
391 buffer[bufferSize - 1] = '\0';
392 }
393
394 return buffer;
395 }
396
397 std::vector<std::string_view> split(std::string_view s, std::string_view delimiter)
398 {

Callers 1

GetOptionCaptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected