diff options
author | Robin Cornelius | 2010-10-09 10:20:10 +0100 |
---|---|---|
committer | Robin Cornelius | 2010-10-09 15:58:13 +0100 |
commit | b6ca1620c712288268913dfb616fbd3d96c1fcf5 (patch) | |
tree | 2821da61456ca991758aa5bb0482af4ca8afe22f | |
parent | Changed version to Experimental 2010.10.09 (diff) | |
download | meta-impy-b6ca1620c712288268913dfb616fbd3d96c1fcf5.zip meta-impy-b6ca1620c712288268913dfb616fbd3d96c1fcf5.tar.gz meta-impy-b6ca1620c712288268913dfb616fbd3d96c1fcf5.tar.bz2 meta-impy-b6ca1620c712288268913dfb616fbd3d96c1fcf5.tar.xz |
Fix some STL errors highlighted by MSVC debug
-rw-r--r-- | linden/indra/llrender/llfontregistry.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llui/lllineeditor.cpp | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/linden/indra/llrender/llfontregistry.cpp b/linden/indra/llrender/llfontregistry.cpp index 2140dbd..9792a91 100644 --- a/linden/indra/llrender/llfontregistry.cpp +++ b/linden/indra/llrender/llfontregistry.cpp | |||
@@ -107,7 +107,7 @@ bool removeSubString(std::string& str, const std::string& substr) | |||
107 | size_t pos = str.find(substr); | 107 | size_t pos = str.find(substr); |
108 | if (pos != string::npos) | 108 | if (pos != string::npos) |
109 | { | 109 | { |
110 | str.replace(pos,substr.length(),(const char *)NULL, 0); | 110 | str.erase(pos,substr.length()); |
111 | return true; | 111 | return true; |
112 | } | 112 | } |
113 | return false; | 113 | return false; |
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index e73b287..a3785e4 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp | |||
@@ -416,7 +416,16 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) | |||
416 | setCursor(llmin((S32)mText.length(), getCursor())); | 416 | setCursor(llmin((S32)mText.length(), getCursor())); |
417 | 417 | ||
418 | // Set current history line to end of history. | 418 | // Set current history line to end of history. |
419 | mCurrentHistoryLine = mLineHistory.end() - 1; | 419 | // RC Fix, its really not safe to just take 1 of the end itterator, if end==begin |
420 | // that leaves an invalid state upseting the secure STL checks | ||
421 | if(mLineHistory.empty()) | ||
422 | { | ||
423 | mCurrentHistoryLine = mLineHistory.begin(); | ||
424 | } | ||
425 | else | ||
426 | { | ||
427 | mCurrentHistoryLine = mLineHistory.end() - 1; | ||
428 | } | ||
420 | 429 | ||
421 | mPrevText = mText; | 430 | mPrevText = mText; |
422 | } | 431 | } |