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

Function AllocString

src/vstdlib/strtools.cpp:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#endif //_WIN32
23
24BEGIN_TIER0_NAMESPACE
25
26static char* AllocString( const char *pStr, int nMaxChars )
27{
28 int allocLen;
29 if ( nMaxChars == -1 )
30 allocLen = V_strlen( pStr ) + 1;
31 else
32 allocLen = Min( V_strlen(pStr), nMaxChars ) + 1;
33
34 char *pOut = new char[allocLen];
35 V_strncpy( pOut, pStr, allocLen );
36 return pOut;
37}
38
39int V_strncmp( const char *s1, const char *s2, int count )
40{

Callers 1

V_SplitString2Function · 0.85

Calls 2

V_strlenFunction · 0.85
V_strncpyFunction · 0.85

Tested by

no test coverage detected