]> git.lizzy.rs Git - irrlicht.git/commitdiff
Fix two irrString bugs
authorsfan5 <sfan5@live.de>
Fri, 11 Nov 2022 15:24:27 +0000 (16:24 +0100)
committersfan5 <sfan5@live.de>
Fri, 11 Nov 2022 15:24:27 +0000 (16:24 +0100)
* append() missing null-termination
* eraseTrailingFloatZeros() was accidentally broken, comment it out for now

include/irrString.h

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