diff options
-rw-r--r-- | common/str.cpp | 6 | ||||
-rw-r--r-- | common/str.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/common/str.cpp b/common/str.cpp index 20844894b8..bea7056991 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -45,7 +45,11 @@ static int computeCapacity(int len) { } String::String(const char *str, uint32 len) -: _len(0), _str(_storage), _storage() { +: _len(0), _str(_storage) { + + // Init _storage member explicitly (ie. without calling its constructor) + // for GCC 2.95.x compatibility (see also tracker item #1602879). + _storage[0] = 0; if (str && *str) { const uint32 tmp = strlen(str); diff --git a/common/str.h b/common/str.h index 3a57be0ce4..c611b3df87 100644 --- a/common/str.h +++ b/common/str.h @@ -96,7 +96,7 @@ public: static const char *emptyString; #endif - String() : _len(0), _str(_storage), _storage() {} + String() : _len(0), _str(_storage) { _storage[0] = 0; } String(const char *str, uint32 len = 0); String(const String &str); virtual ~String(); |