| 2348 | #endif |
| 2349 | |
| 2350 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 2351 | { |
| 2352 | va_list args; |
| 2353 | va_start(args, fmt); |
| 2354 | #ifdef IMGUI_USE_STB_SPRINTF |
| 2355 | int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); |
| 2356 | #else |
| 2357 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 2358 | #endif |
| 2359 | va_end(args); |
| 2360 | if (buf == NULL) |
| 2361 | return w; |
| 2362 | if (w == -1 || w >= (int)buf_size) |
| 2363 | w = (int)buf_size - 1; |
| 2364 | buf[w] = 0; |
| 2365 | return w; |
| 2366 | } |
| 2367 | |
| 2368 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 2369 | { |
no outgoing calls
no test coverage detected