| 1821 | #endif |
| 1822 | |
| 1823 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 1824 | { |
| 1825 | va_list args; |
| 1826 | va_start(args, fmt); |
| 1827 | #ifdef IMGUI_USE_STB_SPRINTF |
| 1828 | int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); |
| 1829 | #else |
| 1830 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 1831 | #endif |
| 1832 | va_end(args); |
| 1833 | if (buf == NULL) |
| 1834 | return w; |
| 1835 | if (w == -1 || w >= (int)buf_size) |
| 1836 | w = (int)buf_size - 1; |
| 1837 | buf[w] = 0; |
| 1838 | return w; |
| 1839 | } |
| 1840 | |
| 1841 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 1842 | { |
no outgoing calls
no test coverage detected