| 2166 | #endif |
| 2167 | |
| 2168 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 2169 | { |
| 2170 | va_list args; |
| 2171 | va_start(args, fmt); |
| 2172 | #ifdef IMGUI_USE_STB_SPRINTF |
| 2173 | int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); |
| 2174 | #else |
| 2175 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 2176 | #endif |
| 2177 | va_end(args); |
| 2178 | if (buf == NULL) |
| 2179 | return w; |
| 2180 | if (w == -1 || w >= (int)buf_size) |
| 2181 | w = (int)buf_size - 1; |
| 2182 | buf[w] = 0; |
| 2183 | return w; |
| 2184 | } |
| 2185 | |
| 2186 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 2187 | { |
no outgoing calls
no test coverage detected