diff options
author | Adam Moss <moss@lindenlab.com> | 2009-04-16 23:45:35 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-04-16 23:45:35 +0000 |
commit | b01c75cb423f07a3d3354f8bd62f265f80062b3b (patch) | |
tree | dec1b220c24a60cc220d1cb07fd3545610644f0a /indra/llcharacter/llkeyframemotionparam.cpp | |
parent | 868250bdd74f348557102c0d8408d9bec30331f6 (diff) |
svn merge -r117314:117337
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1
QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
Diffstat (limited to 'indra/llcharacter/llkeyframemotionparam.cpp')
-rw-r--r-- | indra/llcharacter/llkeyframemotionparam.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp index a9c1f6fc45..622405a5e1 100644 --- a/indra/llcharacter/llkeyframemotionparam.cpp +++ b/indra/llcharacter/llkeyframemotionparam.cpp @@ -364,18 +364,13 @@ BOOL LLKeyframeMotionParam::loadMotions() } // allocate a text buffer - char *text = new char[ fileSize+1 ]; - if ( !text ) - { - llinfos << "ERROR: can't allocated keyframe text buffer." << llendl; - return FALSE; - } + std::vector<char> text(fileSize+1); //------------------------------------------------------------------------- // load data from file into buffer //------------------------------------------------------------------------- bool error = false; - char *p = text; + char *p = &text[0]; while ( 1 ) { if (apr_file_eof(fp) == APR_EOF) @@ -399,12 +394,11 @@ BOOL LLKeyframeMotionParam::loadMotions() //------------------------------------------------------------------------- // check for error //------------------------------------------------------------------------- - llassert( p <= (text+fileSize) ); + llassert( p <= (&text[0] + fileSize) ); if ( error ) { llinfos << "ERROR: error while reading from " << path << llendl; - delete [] text; return FALSE; } @@ -413,7 +407,7 @@ BOOL LLKeyframeMotionParam::loadMotions() //------------------------------------------------------------------------- // parse the text and build keyframe data structures //------------------------------------------------------------------------- - p = text; + p = &text[0]; S32 num; char strA[80]; /* Flawfinder: ignore */ char strB[80]; /* Flawfinder: ignore */ @@ -432,7 +426,6 @@ BOOL LLKeyframeMotionParam::loadMotions() if ((num != 3)) { llinfos << "WARNING: can't read parametric motion" << llendl; - delete [] text; return FALSE; } @@ -453,7 +446,6 @@ BOOL LLKeyframeMotionParam::loadMotions() num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */ } - delete [] text; return TRUE; } |