From 6f98515f344eb34e9317ef9bb92fee3a2a2bee95 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 11 Nov 2022 16:24:27 +0100 Subject: [PATCH] Fix two irrString bugs * append() missing null-termination * eraseTrailingFloatZeros() was accidentally broken, comment it out for now --- include/irrString.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/irrString.h b/include/irrString.h index d8757af8..0742e0b8 100644 --- a/include/irrString.h +++ b/include/irrString.h @@ -38,7 +38,7 @@ template > class string; static size_t multibyteToWString(string& destination, const char* source, u32 sourceSize); static size_t wStringToMultibyte(string& destination, const wchar_t* source, u32 sourceSize); -inline bool isdigit(s32 c); +//inline bool isdigit(s32 c); //! Returns a character converted to lower case static inline u32 locale_lower ( u32 x ) @@ -638,6 +638,7 @@ public: array[l+used] = *(other+l); used += len; + array[used-1] = 0; return *this; } @@ -1250,6 +1251,7 @@ public: return (*this = subString(begin, (end +1) - begin)); } +#if 0 //! 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 ending up with lots of zeros which don't add any value. Erase 'em all. @@ -1285,6 +1287,7 @@ public: } return *this; } +#endif //! Erases a character from the string. /** May be slow, because all elements