diff options
author | Robin Cornelius | 2010-10-09 10:20:10 +0100 |
---|---|---|
committer | McCabe Maxsted | 2010-10-09 02:36:14 -0700 |
commit | 0e86bfee3d1dd0e42fef23293242f52793f08583 (patch) | |
tree | 2821da61456ca991758aa5bb0482af4ca8afe22f /linden/indra/llui/lllineeditor.cpp | |
parent | Changed version to Experimental 2010.10.09 (diff) | |
download | meta-impy-0e86bfee3d1dd0e42fef23293242f52793f08583.zip meta-impy-0e86bfee3d1dd0e42fef23293242f52793f08583.tar.gz meta-impy-0e86bfee3d1dd0e42fef23293242f52793f08583.tar.bz2 meta-impy-0e86bfee3d1dd0e42fef23293242f52793f08583.tar.xz |
Fix some STL errors highlighted by MSVC debug
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/lllineeditor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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 | } |