Fix two irrString bugs

* append() missing null-termination
* eraseTrailingFloatZeros() was accidentally broken, comment it out for now
This commit is contained in:
sfan5 2022-11-11 16:24:27 +01:00
parent a549d0bfed
commit 6f98515f34

@ -38,7 +38,7 @@ template <typename T, typename TAlloc = irrAllocator<T> >
class string; class string;
static size_t multibyteToWString(string<wchar_t>& destination, const char* source, u32 sourceSize); static size_t multibyteToWString(string<wchar_t>& destination, const char* source, u32 sourceSize);
static size_t wStringToMultibyte(string<c8>& destination, const wchar_t* source, u32 sourceSize); static size_t wStringToMultibyte(string<c8>& destination, const wchar_t* source, u32 sourceSize);
inline bool isdigit(s32 c); //inline bool isdigit(s32 c);
//! Returns a character converted to lower case //! Returns a character converted to lower case
static inline u32 locale_lower ( u32 x ) static inline u32 locale_lower ( u32 x )
@ -638,6 +638,7 @@ public:
array[l+used] = *(other+l); array[l+used] = *(other+l);
used += len; used += len;
array[used-1] = 0;
return *this; return *this;
} }
@ -1250,6 +1251,7 @@ public:
return (*this = subString(begin, (end +1) - begin)); return (*this = subString(begin, (end +1) - begin));
} }
#if 0
//! Erase 0's at the end when a string ends with a floating point number //! Erase 0's at the end when a string ends with a floating point number
/** After generating strings from floats we often end up with strings /** After generating strings from floats we often end up with strings
ending up with lots of zeros which don't add any value. Erase 'em all. ending up with lots of zeros which don't add any value. Erase 'em all.
@ -1285,6 +1287,7 @@ public:
} }
return *this; return *this;
} }
#endif
//! Erases a character from the string. //! Erases a character from the string.
/** May be slow, because all elements /** May be slow, because all elements