diff options
author | Jonathan Gray | 2002-09-15 09:06:58 +0000 |
---|---|---|
committer | Jonathan Gray | 2002-09-15 09:06:58 +0000 |
commit | 9ce78dd66e5b893bcfe8629ca1e880ab7c10682d (patch) | |
tree | 700264d2dbeabecaba599e55208fafe1c37e6c12 /common/str.cpp | |
parent | e6751d0d8f49e326ea7b1f6f506d1a9dfbd875db (diff) | |
download | scummvm-rg350-9ce78dd66e5b893bcfe8629ca1e880ab7c10682d.tar.gz scummvm-rg350-9ce78dd66e5b893bcfe8629ca1e880ab7c10682d.tar.bz2 scummvm-rg350-9ce78dd66e5b893bcfe8629ca1e880ab7c10682d.zip |
apply patch #609508 real fix for MI2 Dialog Box crash, by CCCP at Endy's request
svn-id: r4943
Diffstat (limited to 'common/str.cpp')
-rw-r--r-- | common/str.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/str.cpp b/common/str.cpp index 1229c14566..85ceb965d4 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -20,15 +20,15 @@ #include "stdafx.h" #include "str.h" - +#include "util.h" namespace ScummVM { String::String(const char *str) { _refCount = new int(1); - if (str) { - _capacity = _len = strlen(str); + if (str) { + _capacity = _len = resStrLen(str); _str = (char *)calloc(1, _capacity+1); memcpy(_str, str, _len+1); } else { @@ -41,8 +41,8 @@ String::String(const ConstString &str) { printf("String::String(const ConstString &str)\n"); _refCount = new int(1); - if (str._str) { - _capacity = _len = strlen(str._str); + if (str._str) { + _capacity = _len = resStrLen(str._str); _str = (char *)calloc(1, _capacity+1); memcpy(_str, str._str, _len+1); } else { @@ -77,8 +77,8 @@ void String::decRefCount() } String& String::operator =(const char* str) -{ - int len = strlen(str); +{ + int len = resStrLen(str); if (len > 0) { ensureCapacity(len, false); @@ -111,7 +111,7 @@ String& String::operator =(const String& str) String& String::operator +=(const char* str) { - int len = strlen(str); + int len = resStrLen(str); if (len > 0) { ensureCapacity(_len + len, true); |