MCPcopy Create free account
hub / github.com/Wassimulator/CactusViewer / UI_sprintf

Function UI_sprintf

include/ui/ui_core.cpp:207–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206
207char* UI_sprintf(StableDynarray<char>* string_array, const char *format, ...) {
208
209 va_list va;
210 va_start(va, format);
211 int size = vsnprintf(0, 0, format, va);
212 char* result = 0;
213
214 if (string_array->count + size + 1 < string_array->capacity)
215 {
216 string_array->commit(string_array->_grow_capacity(string_array->count + size + 1));
217 }
218
219 if (size >= 0) {
220 result = &string_array->data[string_array->count];
221 vsnprintf(&string_array->data[string_array->count], size + 1, format, va);
222 string_array->count += size + 1;
223 }
224 va_end(va);
225
226 return result;
227}
228
229UI_Block *UI_get_current_parent(UI_Context *ctx) {
230 if (ctx->parents.count)

Callers 1

load_image_wic_preFunction · 0.85

Calls 2

commitMethod · 0.80
_grow_capacityMethod · 0.80

Tested by

no test coverage detected