summaryrefslogtreecommitdiff
path: root/indra/newview/llfilepicker.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-05-02 21:24:47 +0000
committerDon Kjer <don@lindenlab.com>2007-05-02 21:24:47 +0000
commit1c909afe3998778e4cc045c9ab733e8afbf7c25b (patch)
tree75c00a32a8e305280cbec253195d1113d628fc3e /indra/newview/llfilepicker.cpp
parentbc59c04653bf1404e8148a8169208b146a123b28 (diff)
svn merge -r 60342:61148 svn+ssh://svn/svn/linden/branches/maintenance into release
Diffstat (limited to 'indra/newview/llfilepicker.cpp')
-rw-r--r--indra/newview/llfilepicker.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 4a69286493..6f43460f70 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -431,8 +431,9 @@ void LLFilePicker::reset()
void LLFilePicker::buildFilename( void )
{
- strncpy( mFilename, mFiles, LL_MAX_PATH ); /*Flawfinder: ignore*/
- S32 len = strlen( mFilename ); /*Flawfinder: ignore*/
+ strncpy( mFilename, mFiles, LL_MAX_PATH );
+ mFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy
+ S32 len = strlen( mFilename );
strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/
len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/
@@ -838,7 +839,10 @@ void LLFilePicker::getFilePath(SInt32 index)
{
mFiles[0] = 0;
if (mFileVector.size())
- strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); /*Flawfinder: ignore*/
+ {
+ strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles));
+ mFiles[sizeof(mFiles)-1] = '\0'; // stupid strncpy
+ }
}
void LLFilePicker::getFileName(SInt32 index)
@@ -848,7 +852,10 @@ void LLFilePicker::getFileName(SInt32 index)
{
char *start = strrchr(mFileVector[index].c_str(), '/');
if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size())))
- strncpy(mFilename, start + 1, sizeof(mFilename)); /*Flawfinder: ignore*/
+ {
+ strncpy(mFilename, start + 1, sizeof(mFilename));
+ mFilename[sizeof(mFilename)-1] = '\0';// stupid strncpy
+ }
}
}