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

Function BCheckAndEatBytes

src/common/keypair.cpp:15–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13static const char k_szOpenSSHPrivatKeyPEMFooter[] = "-----END OPENSSH PRIVATE KEY-----";
14
15static bool BCheckAndEatBytes( CUtlBuffer &buf, const void *data, int sz )
16{
17 if ( buf.GetBytesRemaining() < sz )
18 return false;
19 if ( V_memcmp( buf.PeekGet(), data, sz ) != 0 )
20 return false;
21 buf.SeekGet( CUtlBuffer::SEEK_CURRENT, sz );
22 return true;
23}
24
25static bool BOpenSSHGetUInt32( CUtlBuffer &buf, uint32 &result )
26{

Calls 4

V_memcmpFunction · 0.85
GetBytesRemainingMethod · 0.80
SeekGetMethod · 0.80
PeekGetMethod · 0.45

Tested by

no test coverage detected