MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / vsnprintf

Function vsnprintf

Source/3rdParty/bx/src/string.cpp:1231–1262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229 }
1230
1231 int32_t vsnprintf(char* _out, int32_t _max, const char* _format, va_list _argList)
1232 {
1233 if ( 0 < _max
1234 && NULL != _out)
1235 {
1236 StaticMemoryBlockWriter writer(_out, uint32_t(_max) );
1237
1238 Error err;
1239 va_list argListCopy;
1240 va_copy(argListCopy, _argList);
1241 int32_t size = write(&writer, _format, argListCopy, &err);
1242 va_end(argListCopy);
1243
1244 size += write(&writer, '\0', &err);
1245
1246 if (err.isOk() )
1247 {
1248 return size - 1 /* size without '\0' terminator */;
1249 }
1250
1251 _out[_max-1] = '\0';
1252 }
1253
1254 Error err;
1255 SizerWriter sizer;
1256 va_list argListCopy;
1257 va_copy(argListCopy, _argList);
1258 int32_t total = write(&sizer, _format, argListCopy, &err);
1259 va_end(argListCopy);
1260
1261 return total;
1262 }
1263
1264 int32_t snprintf(char* _out, int32_t _max, const char* _format, ...)
1265 {

Callers 15

debugPrintfVargsFunction · 0.70
snprintfFunction · 0.70
sprintfFunction · 0.50
NFDi_SetFormattedErrorFunction · 0.50
TraceNodeMethod · 0.50
trace_add_dataFunction · 0.50
vasprintf_rewrite_tailFunction · 0.50
_mesa_vsnprintfFunction · 0.50
_mesa_snprintfFunction · 0.50
printf_lengthFunction · 0.50
ralloc_vasprintfFunction · 0.50

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected