Tier1: use SSIZE_MAX for default str slice buf end

Will be INT_MAX on 32bit platform and INT64_MAX on 64bit.
This commit is contained in:
Kawe Mazidjatari 2024-02-10 01:20:35 +01:00
parent 8b338ce682
commit 24f41ef6c7

View File

@ -14,10 +14,6 @@
#include "tier1/strtools.h"
#include "limits.h"
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t) -1)
#endif
//-----------------------------------------------------------------------------
// Base class, containing simple memory management
//-----------------------------------------------------------------------------
@ -260,7 +256,7 @@ public:
// Take a piece out of the string.
// If you only specify nStart, it'll go from nStart to the end.
// You can use negative numbers and it'll wrap around to the start.
CUtlString Slice( ssize_t nStart=0, ssize_t nEnd=INT_MAX );
CUtlString Slice( ssize_t nStart=0, ssize_t nEnd=SSIZE_MAX );
// Grab a substring starting from the left or the right side.
CUtlString Left( ssize_t nChars );