| 1476 | #endif |
| 1477 | |
| 1478 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 1479 | { |
| 1480 | va_list args; |
| 1481 | va_start(args, fmt); |
| 1482 | #ifdef IMGUI_USE_STB_SPRINTF |
| 1483 | int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); |
| 1484 | #else |
| 1485 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 1486 | #endif |
| 1487 | va_end(args); |
| 1488 | if (buf == NULL) |
| 1489 | return w; |
| 1490 | if (w == -1 || w >= (int)buf_size) |
| 1491 | w = (int)buf_size - 1; |
| 1492 | buf[w] = 0; |
| 1493 | return w; |
| 1494 | } |
| 1495 | |
| 1496 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 1497 | { |
no outgoing calls
no test coverage detected