| 2016 | #endif |
| 2017 | |
| 2018 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 2019 | { |
| 2020 | va_list args; |
| 2021 | va_start(args, fmt); |
| 2022 | #ifdef IMGUI_USE_STB_SPRINTF |
| 2023 | int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); |
| 2024 | #else |
| 2025 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 2026 | #endif |
| 2027 | va_end(args); |
| 2028 | if (buf == NULL) |
| 2029 | return w; |
| 2030 | if (w == -1 || w >= (int)buf_size) |
| 2031 | w = (int)buf_size - 1; |
| 2032 | buf[w] = 0; |
| 2033 | return w; |
| 2034 | } |
| 2035 | |
| 2036 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 2037 | { |
no outgoing calls
no test coverage detected