diff options
author | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
commit | c07901e29ed545bbb02e3bddf148fe1104b94e9f (patch) | |
tree | f1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/newview/llfilepicker.cpp | |
parent | Second Life viewer sources 1.15.0.2 (diff) | |
download | meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2 meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz |
Second Life viewer sources 1.15.1.3
Diffstat (limited to 'linden/indra/newview/llfilepicker.cpp')
-rw-r--r-- | linden/indra/newview/llfilepicker.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/linden/indra/newview/llfilepicker.cpp b/linden/indra/newview/llfilepicker.cpp index 971743b..24d3932 100644 --- a/linden/indra/newview/llfilepicker.cpp +++ b/linden/indra/newview/llfilepicker.cpp | |||
@@ -451,8 +451,9 @@ void LLFilePicker::reset() | |||
451 | 451 | ||
452 | void LLFilePicker::buildFilename( void ) | 452 | void LLFilePicker::buildFilename( void ) |
453 | { | 453 | { |
454 | strncpy( mFilename, mFiles, LL_MAX_PATH ); /*Flawfinder: ignore*/ | 454 | strncpy( mFilename, mFiles, LL_MAX_PATH ); |
455 | S32 len = strlen( mFilename ); /*Flawfinder: ignore*/ | 455 | mFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy |
456 | S32 len = strlen( mFilename ); | ||
456 | 457 | ||
457 | strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/ | 458 | strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/ |
458 | len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/ | 459 | len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/ |
@@ -858,7 +859,10 @@ void LLFilePicker::getFilePath(SInt32 index) | |||
858 | { | 859 | { |
859 | mFiles[0] = 0; | 860 | mFiles[0] = 0; |
860 | if (mFileVector.size()) | 861 | if (mFileVector.size()) |
861 | strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); /*Flawfinder: ignore*/ | 862 | { |
863 | strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); | ||
864 | mFiles[sizeof(mFiles)-1] = '\0'; // stupid strncpy | ||
865 | } | ||
862 | } | 866 | } |
863 | 867 | ||
864 | void LLFilePicker::getFileName(SInt32 index) | 868 | void LLFilePicker::getFileName(SInt32 index) |
@@ -868,7 +872,10 @@ void LLFilePicker::getFileName(SInt32 index) | |||
868 | { | 872 | { |
869 | char *start = strrchr(mFileVector[index].c_str(), '/'); | 873 | char *start = strrchr(mFileVector[index].c_str(), '/'); |
870 | if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size()))) | 874 | if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size()))) |
871 | strncpy(mFilename, start + 1, sizeof(mFilename)); /*Flawfinder: ignore*/ | 875 | { |
876 | strncpy(mFilename, start + 1, sizeof(mFilename)); | ||
877 | mFilename[sizeof(mFilename)-1] = '\0';// stupid strncpy | ||
878 | } | ||
872 | } | 879 | } |
873 | } | 880 | } |
874 | 881 | ||