Skip to content

Commit 6cf5378

Browse files
committed
Fix bug formating GenericBytes identities.
It's amazing the bugs that can be found once code actually gets executed. This used to work. It broke when I changed the prefix text and forgot to update the hardcoded literals. [Insert comment here about the evils of using hadrcoded literals. Yes yes.]
1 parent 970f0e0 commit 6cf5378

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/steamnetworkingsockets/steamnetworkingsockets_shared.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString(
298298

299299
case k_ESteamNetworkingIdentityType_GenericBytes:
300300
V_strncpy( buf, "gen:", cbBuf );
301-
if ( cbBuf > 8 )
301+
if ( cbBuf > 5 )
302302
{
303303
static const char hexdigits[] = "0123456789abcdef";
304-
char *d = buf+7;
305-
int l = std::min( identity.m_cbSize, int(cbBuf-8) / 2 );
304+
char *d = buf+4;
305+
int l = std::min( identity.m_cbSize, int(cbBuf-5) / 2 );
306306
for ( int i = 0 ; i < l ; ++i )
307307
{
308308
uint8 b = identity.m_genericBytes[i];

0 commit comments

Comments
 (0)