MCPcopy Create free account
hub / github.com/crawl/crawl / vmake_stringf

Function vmake_stringf

crawl-ref/source/stringutil.cc:277–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277string vmake_stringf(const char* s, va_list args)
278{
279 char buf1[8000];
280 va_list orig_args;
281 va_copy(orig_args, args);
282 size_t len = vsnprintf(buf1, sizeof buf1, s, orig_args);
283 va_end(orig_args);
284 if (len < sizeof buf1)
285 return buf1;
286
287 char *buf2 = (char*)malloc(len + 1);
288 va_copy(orig_args, args);
289 vsnprintf(buf2, len + 1, s, orig_args);
290 va_end(orig_args);
291 string ret(buf2);
292 free(buf2);
293
294 return ret;
295}
296
297string make_stringf(const char *s, ...)
298{

Callers 13

nowrap_eol_cprintfFunction · 0.85
wrapcprintfFunction · 0.85
add_fieldMethod · 0.85
_cprintf_touchuiFunction · 0.85
report_errorMethod · 0.85
_display_char_statusFunction · 0.85
debug_dump_itemFunction · 0.85
cprintfMethod · 0.85
failFunction · 0.85
sysfailFunction · 0.85
corruptedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected