Update Buffer.hpp

This commit is contained in:
Sandu Liviu Catalin committed 2021-06-11 17:44:18 +03:00
1 parent ccfae607d7
commit 7fbf1ee4e1
1 file changed
+3 -3
+3 -3
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();
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------