| 1119 | // B) When buf==NULL vsnprintf() will return the output size. |
| 1120 | #ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS |
| 1121 | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) |
| 1122 | { |
| 1123 | va_list args; |
| 1124 | va_start(args, fmt); |
| 1125 | int w = vsnprintf(buf, buf_size, fmt, args); |
| 1126 | va_end(args); |
| 1127 | if (buf == NULL) |
| 1128 | return w; |
| 1129 | if (w == -1 || w >= (int)buf_size) |
| 1130 | w = (int)buf_size - 1; |
| 1131 | buf[w] = 0; |
| 1132 | return w; |
| 1133 | } |
| 1134 | |
| 1135 | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) |
| 1136 | { |
no outgoing calls
no test coverage detected