1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-31 09:57:14 +01:00

Update Buffer.hpp

This commit is contained in:
Sandu Liviu Catalin 2021-06-11 17:44:18 +03:00
parent ccfae607d7
commit 7fbf1ee4e1

View File

@ -765,7 +765,7 @@ public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Retrieve the buffer as a string. * Retrieve the buffer as a string.
*/ */
String ToStr() const SQMOD_NODISCARD String ToStr() const
{ {
return m_Ptr ? String(Get< String::value_type >(), Position()) : String(); return m_Ptr ? String(Get< String::value_type >(), Position()) : String();
} }
@ -773,9 +773,9 @@ public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Retrieve the buffer as a string. * Retrieve the buffer as a string.
*/ */
String ToStr(SzType p) const SQMOD_NODISCARD String ToStr(SzType p) const
{ {
return m_Ptr ? String(Get< String::value_type >(), ClampMax(p, m_Cap)) : String(); return m_Ptr ? String(Get< String::value_type >(), std::min(p, m_Cap)) : String();
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------