MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / V_snprintf

Function V_snprintf

src/vstdlib/strtools.cpp:259–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259int V_snprintf( char *pDest, size_t bufferLen, char const *pFormat, ... )
260{
261 Assert( bufferLen > 0 );
262 Assert( pDest != NULL );
263 Assert( pFormat != NULL );
264
265 va_list marker;
266
267 va_start( marker, pFormat );
268 // _vsnprintf will not write a terminator if the output string uses the entire buffer you provide
269 int len = _vsnprintf( pDest, bufferLen, pFormat, marker );
270 va_end( marker );
271
272 // Len < 0 represents an overflow on windows; len > buffer length on posix
273 if (( len < 0 ) || ((size_t)len >= bufferLen ) )
274 {
275 len = (int)(bufferLen-1);
276 }
277 pDest[len] = 0;
278
279 return len;
280}
281
282int V_vsnprintf( char *pDest, int bufferLen, char const *pFormat, va_list params )
283{

Callers 15

SetInt8Method · 0.85
SetUint8Method · 0.85
SetInt16Method · 0.85
SetUint16Method · 0.85
SetInt32Method · 0.85
SetUint32Method · 0.85
SetInt64Method · 0.85
SetUint64Method · 0.85
SetDoubleMethod · 0.85
SetFloatMethod · 0.85
RenderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected