| 1371 | #endif |
| 1372 | |
| 1373 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 1374 | { |
| 1375 | va_list args; |
| 1376 | va_start(args, fmt); |
| 1377 | #ifdef IMGUI_USE_STB_SPRINTF |
| 1378 | int w = stbsp_vsnprintf(buf, (int)buf_size, fmt, args); |
| 1379 | #else |
| 1380 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 1381 | #endif |
| 1382 | va_end(args); |
| 1383 | if (buf == NULL) |
| 1384 | return w; |
| 1385 | if (w == -1 || w >= (int)buf_size) |
| 1386 | w = (int)buf_size - 1; |
| 1387 | buf[w] = 0; |
| 1388 | return w; |
| 1389 | } |
| 1390 | |
| 1391 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 1392 | { |
no outgoing calls
no test coverage detected