svn merge -r59459:59476 svn+ssh://svn.lindenlab.com/svn/linden/branches/adroit.r69-75_2 into svn+ssh://svn.lindenlab.com/svn/linden/release.
parent
5e9e67cb2d
commit
fceae96eb1
|
|
@ -570,7 +570,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
|||
timer.reset();
|
||||
|
||||
uuid.toString(uuid_str);
|
||||
snprintf(d_path, LL_MAX_PATH, "%s.dsf", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(d_path, LL_MAX_PATH, "%s.dsf", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str()); /* Flawfinder: ignore */
|
||||
|
||||
mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path);
|
||||
if (!mCurrentDecodep->initDecode())
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
//--------------------------------------------------------------------
|
||||
char path[LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
|
||||
snprintf( path, sizeof(path), "%s",/* Flawfinder: ignore */
|
||||
snprintf( path, sizeof(path), "%s", /* Flawfinder: ignore */
|
||||
gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName).c_str());
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1708,11 +1708,11 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
|
|||
success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset");
|
||||
if (shared_constraintp->mConstraintTargetType == TYPE_GROUND)
|
||||
{
|
||||
snprintf(volume_name,sizeof(volume_name), "%s", "GROUND"); /* Flawfinder: ignore */
|
||||
snprintf(volume_name,sizeof(volume_name), "%s", "GROUND"); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */
|
||||
snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */
|
||||
mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str());
|
||||
}
|
||||
success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume");
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
|
|||
// Load data into a buffer to be parsed.
|
||||
//-------------------------------------------------------------------------
|
||||
char path[LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
snprintf( path,sizeof(path), "%s_%s.llp", /* Flawfinder: ignore */
|
||||
snprintf( path,sizeof(path), "%s_%s.llp",
|
||||
gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()).c_str(),
|
||||
getName().c_str() );
|
||||
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ std::string LLGestureStepWait::getLabel() const
|
|||
if (mFlags & WAIT_FLAG_TIME)
|
||||
{
|
||||
char buffer[64]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */
|
||||
label += buffer;
|
||||
}
|
||||
else if (mFlags & WAIT_FLAG_ALL_ANIM)
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@
|
|||
#endif
|
||||
|
||||
// Deal with the differeneces on Windows
|
||||
#if defined(LL_WINDOWS)
|
||||
#define snprintf _snprintf /*Flawfinder: ignore*/
|
||||
#endif // LL_WINDOWS
|
||||
#if LL_WINDOWS
|
||||
#define snprintf safe_snprintf /* Flawfinder: ignore */
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
// Static linking with apr on windows needs to be declared.
|
||||
#ifdef LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ bool CProcessor::AnalyzeIntelProcessor()
|
|||
else
|
||||
{
|
||||
// If there's no serial number support we just put "No serial number"
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
CPUInfo.strProcessorSerial,
|
||||
sizeof(CPUInfo.strProcessorSerial),
|
||||
"No Processor Serial Number");
|
||||
|
|
@ -974,7 +974,7 @@ bool CProcessor::AnalyzeAMDProcessor()
|
|||
if ((ecxreg >> 24) > 0)
|
||||
{
|
||||
CPUInfo._L1.Data.bPresent = true;
|
||||
snprintf(CPUInfo._L1.Data.strSize, sizeof(CPUInfo._L1.Data.strSize), "%d KB", ecxreg >> 24); /*Flawfinder: ignore*/
|
||||
snprintf(CPUInfo._L1.Data.strSize, sizeof(CPUInfo._L1.Data.strSize), "%d KB", ecxreg >> 24); /* Flawfinder: ignore */
|
||||
CPUInfo._L1.Data.uiAssociativeWays = (ecxreg >> 15) & 0xFF;
|
||||
CPUInfo._L1.Data.uiLineSize = ecxreg & 0xFF;
|
||||
}
|
||||
|
|
@ -982,7 +982,7 @@ bool CProcessor::AnalyzeAMDProcessor()
|
|||
if ((edxreg >> 24) > 0)
|
||||
{
|
||||
CPUInfo._L1.Instruction.bPresent = true;
|
||||
snprintf(CPUInfo._L1.Instruction.strSize, sizeof(CPUInfo._L1.Instruction.strSize), "%d KB", edxreg >> 24); /*Flawfinder: ignore*/
|
||||
snprintf(CPUInfo._L1.Instruction.strSize, sizeof(CPUInfo._L1.Instruction.strSize), "%d KB", edxreg >> 24); /* Flawfinder: ignore */
|
||||
CPUInfo._L1.Instruction.uiAssociativeWays = (edxreg >> 15) & 0xFF;
|
||||
CPUInfo._L1.Instruction.uiLineSize = edxreg & 0xFF;
|
||||
}
|
||||
|
|
@ -1006,7 +1006,7 @@ bool CProcessor::AnalyzeAMDProcessor()
|
|||
if (((ecxreg >> 12) & 0xF) > 0)
|
||||
{
|
||||
CPUInfo._L2.bPresent = true;
|
||||
snprintf(CPUInfo._L2.strSize, sizeof(CPUInfo._L2.strSize), "%d KB", ecxreg >> 16); /*Flawfinder: ignore*/
|
||||
snprintf(CPUInfo._L2.strSize, sizeof(CPUInfo._L2.strSize), "%d KB", ecxreg >> 16); /* Flawfinder: ignore */
|
||||
switch ((ecxreg >> 12) & 0xF)
|
||||
{
|
||||
case 1:
|
||||
|
|
@ -1099,9 +1099,9 @@ bool CProcessor::AnalyzeUnknownProcessor()
|
|||
strcpy(CPUInfo.strProcessorSerial, "Unknown / Not supported"); /*Flawfinder: ignore*/
|
||||
|
||||
// For the family, model and brand id we can only print the numeric value
|
||||
snprintf(CPUInfo.strBrandID, sizeof(CPUInfo.strBrandID), "Brand-ID number %d", CPUInfo.uiBrandID); /*Flawfinder: ignore*/
|
||||
snprintf(CPUInfo.strFamily, sizeof(CPUInfo.strFamily), "Family number %d", CPUInfo.uiFamily); /*Flawfinder: ignore*/
|
||||
snprintf(CPUInfo.strModel, sizeof(CPUInfo.strModel), "Model number %d", CPUInfo.uiModel); /*Flawfinder: ignore*/
|
||||
snprintf(CPUInfo.strBrandID, sizeof(CPUInfo.strBrandID), "Brand-ID number %d", CPUInfo.uiBrandID); /* Flawfinder: ignore */
|
||||
snprintf(CPUInfo.strFamily, sizeof(CPUInfo.strFamily), "Family number %d", CPUInfo.uiFamily); /* Flawfinder: ignore */
|
||||
snprintf(CPUInfo.strModel, sizeof(CPUInfo.strModel), "Model number %d", CPUInfo.uiModel); /* Flawfinder: ignore */
|
||||
|
||||
// Nevertheless we can determine the processor type
|
||||
switch (CPUInfo.uiType)
|
||||
|
|
@ -1951,7 +1951,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
|
|||
if(l1dcachesize != 0)
|
||||
{
|
||||
CPUInfo._L1.Data.bPresent = true;
|
||||
snprintf(CPUInfo._L1.Data.strSize, sizeof(CPUInfo._L1.Data.strSize), "%d KB", l1dcachesize / 1024); /* Flawfinder: ignore */
|
||||
snprintf(CPUInfo._L1.Data.strSize, sizeof(CPUInfo._L1.Data.strSize), "%d KB", l1dcachesize / 1024); /* Flawfinder: ignore */
|
||||
// CPUInfo._L1.Data.uiAssociativeWays = ???;
|
||||
CPUInfo._L1.Data.uiLineSize = cachelinesize;
|
||||
}
|
||||
|
|
@ -1959,7 +1959,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
|
|||
if(l1icachesize != 0)
|
||||
{
|
||||
CPUInfo._L1.Instruction.bPresent = true;
|
||||
snprintf(CPUInfo._L1.Instruction.strSize, sizeof(CPUInfo._L1.Instruction.strSize), "%d KB", l1icachesize / 1024); /* Flawfinder: ignore */
|
||||
snprintf(CPUInfo._L1.Instruction.strSize, sizeof(CPUInfo._L1.Instruction.strSize), "%d KB", l1icachesize / 1024); /* Flawfinder: ignore */
|
||||
// CPUInfo._L1.Instruction.uiAssociativeWays = ???;
|
||||
CPUInfo._L1.Instruction.uiLineSize = cachelinesize;
|
||||
}
|
||||
|
|
@ -1967,7 +1967,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
|
|||
if(l2cachesize != 0)
|
||||
{
|
||||
CPUInfo._L2.bPresent = true;
|
||||
snprintf(CPUInfo._L2.strSize, sizeof(CPUInfo._L2.strSize), "%d KB", l2cachesize / 1024); /* Flawfinder: ignore */
|
||||
snprintf(CPUInfo._L2.strSize, sizeof(CPUInfo._L2.strSize), "%d KB", l2cachesize / 1024); /* Flawfinder: ignore */
|
||||
// CPUInfo._L2.uiAssociativeWays = ???;
|
||||
CPUInfo._L2.uiLineSize = cachelinesize;
|
||||
}
|
||||
|
|
@ -1975,7 +1975,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
|
|||
if(l3cachesize != 0)
|
||||
{
|
||||
CPUInfo._L2.bPresent = true;
|
||||
snprintf(CPUInfo._L2.strSize, sizeof(CPUInfo._L2.strSize), "%d KB", l3cachesize / 1024); /* Flawfinder: ignore */
|
||||
snprintf(CPUInfo._L2.strSize, sizeof(CPUInfo._L2.strSize), "%d KB", l3cachesize / 1024); /* Flawfinder: ignore */
|
||||
// CPUInfo._L2.uiAssociativeWays = ???;
|
||||
CPUInfo._L2.uiLineSize = cachelinesize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -654,6 +654,33 @@ std::string mbcsstring_makeASCII(const std::string& wstr)
|
|||
return out_str;
|
||||
}
|
||||
|
||||
#if LL_WINDOWS
|
||||
/* If the size of the passed in buffer is not large enough to hold the string,
|
||||
* two bad things happen:
|
||||
* 1. resulting formatted string is NOT null terminated
|
||||
* 2. Depending on the platform, the return value could be a) the required
|
||||
* size of the buffer to copy the entire formatted string or b) -1.
|
||||
* On Windows with VS.Net 2003, it returns -1 e.g.
|
||||
*
|
||||
* safe_snprintf always adds a NULL terminator so that the caller does not
|
||||
* need to check for return value or need to add the NULL terminator.
|
||||
* It does not, however change the return value - to let the caller know
|
||||
* that the passed in buffer size was not large enough to hold the formatted string.
|
||||
*
|
||||
*/
|
||||
int safe_snprintf(char *str, size_t size, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
int num_written = _vsnprintf(str, size, format, args); /* Flawfinder: ignore */
|
||||
va_end(args);
|
||||
|
||||
str[size-1] = '\0'; // always null terminate
|
||||
return num_written;
|
||||
}
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
S32 LLStringOps::collate(const llwchar* a, const llwchar* b)
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdarg.h> /* for vsnprintf */
|
||||
#if LL_LINUX
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
|
|
@ -445,6 +446,9 @@ std::ostream& operator<<(std::ostream &s, const LLStringBase<T> &str)
|
|||
|
||||
std::ostream& operator<<(std::ostream &s, const LLWString &wstr);
|
||||
|
||||
#if LL_WINDOWS
|
||||
int safe_snprintf(char *str, size_t size, const char *format, ...);
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
/**
|
||||
* Many of the 'strip' and 'replace' methods of LLStringBase need
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ LLOSInfo::LLOSInfo() :
|
|||
}
|
||||
else
|
||||
{
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
tmp,
|
||||
sizeof(tmp),
|
||||
"%s (Build %d)",
|
||||
|
|
@ -324,7 +324,7 @@ std::string LLCPUInfo::getCPUStringTerse() const
|
|||
if (freq < 10000.f && freq > 200.f )
|
||||
{
|
||||
char tmp[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(tmp, sizeof(tmp), " (%.0f Mhz)", freq); /* Flawfinder: ignore */
|
||||
snprintf(tmp, sizeof(tmp), " (%.0f Mhz)", freq); /* Flawfinder: ignore */
|
||||
|
||||
cpu_string.append(tmp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ inline S32 LLUUIDHashMap<DATA_TYPE, SIZE>::getLength() const
|
|||
S32 bin;
|
||||
for (bin = 0; bin < 256; bin++)
|
||||
{
|
||||
LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[bin];
|
||||
LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = (LLUUIDHashNode<DATA_TYPE, SIZE>*) &mNodes[bin];
|
||||
while (nodep)
|
||||
{
|
||||
count += nodep->mCount;
|
||||
|
|
@ -421,6 +421,7 @@ public:
|
|||
~LLUUIDHashMapIter();
|
||||
|
||||
|
||||
inline void reset();
|
||||
inline void first();
|
||||
inline void next();
|
||||
inline BOOL done() const;
|
||||
|
|
@ -459,11 +460,18 @@ LLUUIDHashMapIter<DATA_TYPE, SIZE>::LLUUIDHashMapIter(LLUUIDHashMap<DATA_TYPE, S
|
|||
|
||||
template <class DATA_TYPE, int SIZE>
|
||||
LLUUIDHashMapIter<DATA_TYPE, SIZE>::~LLUUIDHashMapIter()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
template <class DATA_TYPE, int SIZE>
|
||||
inline void LLUUIDHashMapIter<DATA_TYPE, SIZE>::reset()
|
||||
{
|
||||
if (mCurHashNodep)
|
||||
{
|
||||
// We're partway through an iteration, we can clean up now
|
||||
mHashMapp->mIterCount--;
|
||||
mCurHashNodep = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1082,7 +1082,7 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu
|
|||
if(inv_type_str)
|
||||
output_stream << "\t\tinv_type\t" << inv_type_str << "\n";
|
||||
char buffer[32]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\tflags\t%08x\n", mFlags); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\tflags\t%08x\n", mFlags); /* Flawfinder: ignore */
|
||||
output_stream << buffer;
|
||||
mSaleInfo.exportLegacyStream(output_stream);
|
||||
output_stream << "\t\tname\t" << mName.c_str() << "|\n";
|
||||
|
|
|
|||
|
|
@ -738,15 +738,15 @@ BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const
|
|||
output_stream << "\t{\n";
|
||||
|
||||
char buffer[256]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\tbase_mask\t%08x\n", mMaskBase); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\tbase_mask\t%08x\n", mMaskBase); /* Flawfinder: ignore */
|
||||
output_stream << buffer;
|
||||
snprintf(buffer, sizeof(buffer), "\t\towner_mask\t%08x\n", mMaskOwner); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\towner_mask\t%08x\n", mMaskOwner); /* Flawfinder: ignore */
|
||||
output_stream << buffer;
|
||||
snprintf(buffer, sizeof(buffer), "\t\tgroup_mask\t%08x\n", mMaskGroup); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\tgroup_mask\t%08x\n", mMaskGroup); /* Flawfinder: ignore */
|
||||
output_stream << buffer;
|
||||
snprintf(buffer, sizeof(buffer), "\t\teveryone_mask\t%08x\n", mMaskEveryone); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\teveryone_mask\t%08x\n", mMaskEveryone); /* Flawfinder: ignore */
|
||||
output_stream << buffer;
|
||||
snprintf(buffer, sizeof(buffer), "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); /* Flawfinder: ignore */
|
||||
output_stream << buffer;
|
||||
|
||||
mCreator.toString(uuid_str);
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ F32 LLVolumeLODGroup::dump()
|
|||
}
|
||||
usage = usage / (F32)NUM_LODS;
|
||||
|
||||
snprintf(dump_str, sizeof(dump_str), "%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]); /* Flawfinder: ignore */
|
||||
snprintf(dump_str, sizeof(dump_str), "%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]); /* Flawfinder: ignore */
|
||||
|
||||
llinfos << dump_str << llendl;
|
||||
return usage;
|
||||
|
|
|
|||
|
|
@ -1253,7 +1253,7 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss
|
|||
char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
|
||||
|
||||
uuid.toString(uuid_str);
|
||||
snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */
|
||||
snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */
|
||||
|
||||
FILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
|
||||
if (fp)
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog()
|
|||
S32 cur_line = 0;
|
||||
for (i = 0; i < mBufferSize; i++)
|
||||
{
|
||||
snprintf(line_buffer + cur_line_pos*3, sizeof(line_buffer) - cur_line_pos*3, "%02x ", mBufferp[i]); /*Flawfinder: ignore*/
|
||||
snprintf(line_buffer + cur_line_pos*3, sizeof(line_buffer) - cur_line_pos*3, "%02x ", mBufferp[i]); /* Flawfinder: ignore */
|
||||
cur_line_pos++;
|
||||
if (cur_line_pos >= 16)
|
||||
{
|
||||
|
|
@ -563,7 +563,7 @@ BOOL LLDataPackerAsciiBuffer::packString(const char *value, const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\n", value); /*Flawfinder: ignore*/
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -572,14 +572,15 @@ BOOL LLDataPackerAsciiBuffer::packString(const char *value, const char *name)
|
|||
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return >= passed in size value. so a check needs to be added
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
// *NOTE: I believe we need to mark a failure bit at this point.
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << llendl;
|
||||
}
|
||||
mCurBufferp += numCopied;
|
||||
return success;
|
||||
|
|
@ -607,7 +608,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%010d ", size); /*Flawfinder: ignore*/
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%010d ", size); /* Flawfinder: ignore */
|
||||
|
||||
// snprintf returns number of bytes that would have been
|
||||
// written had the output not being truncated. In that case,
|
||||
|
|
@ -615,9 +616,10 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
|
|||
// to be added to detect truncation, and if there is any, only
|
||||
// account for the actual number of bytes written..and not
|
||||
// what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << llendl;
|
||||
}
|
||||
mCurBufferp += numCopied;
|
||||
|
||||
|
|
@ -626,10 +628,11 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
|
|||
BOOL bBufferFull = FALSE;
|
||||
for (i = 0; i < size && !bBufferFull; i++)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << llendl;
|
||||
bBufferFull = TRUE;
|
||||
}
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -637,10 +640,11 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
|
|||
|
||||
if (!bBufferFull)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << llendl;
|
||||
}
|
||||
mCurBufferp += numCopied;
|
||||
}
|
||||
|
|
@ -698,10 +702,11 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con
|
|||
BOOL bBufferFull = FALSE;
|
||||
for (i = 0; i < size && !bBufferFull; i++)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << llendl;
|
||||
bBufferFull = TRUE;
|
||||
}
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -709,10 +714,11 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con
|
|||
}
|
||||
if (!bBufferFull)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -762,21 +768,24 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /*Flawfinder: ignore*/
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
// just do the write to a temp buffer to get the length
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%d\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%d\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packU8: val truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -807,20 +816,23 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /*Flawfinder: ignore*/
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%d\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%d\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packU16: val truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -852,19 +864,22 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%u\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%u\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%u\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%u\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packU32: val truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -893,19 +908,22 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%d\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packS32: val truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -934,19 +952,22 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%g\n", value); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%g\n", value); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packF32: val truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -975,19 +996,22 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packColor4: truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -1015,19 +1039,22 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d %d %d %d\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d %d %d %d\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%d %d %d %d\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -1066,15 +1093,18 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na
|
|||
}
|
||||
else
|
||||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packVector2: truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -1109,13 +1139,16 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na
|
|||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g %g\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packVector3: truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -1149,13 +1182,16 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na
|
|||
{
|
||||
numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packVector4: truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -1193,13 +1229,16 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name)
|
|||
{
|
||||
numCopied = 64 + 1; // UUID + newline
|
||||
}
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::packUUID: truncated: " << llendl;
|
||||
success = FALSE;
|
||||
}
|
||||
mCurBufferp += numCopied;
|
||||
|
|
@ -1235,21 +1274,26 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name)
|
|||
int numCopied = 0;
|
||||
if (mWriteEnabled)
|
||||
{
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\t", name); /* Flawfinder: ignore */
|
||||
numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\t", name); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
numCopied = (S32)strlen(name) + 1; /* Flawfinder: ignore */ //name + tab
|
||||
}
|
||||
|
||||
// snprintf returns number of bytes that would have been written had the
|
||||
// output not being truncated. In that case, it will retuen >= passed in size value.
|
||||
// so a check needs to be added to detect truncation, and if there is any,
|
||||
// only account for the actual number of bytes written..and not what could have been written.
|
||||
if (numCopied > getBufferSize()-getCurrentSize())
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
|
||||
{
|
||||
numCopied = getBufferSize()-getCurrentSize();
|
||||
llwarns << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << llendl;
|
||||
}
|
||||
|
||||
mCurBufferp += numCopied;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1405,7 +1449,7 @@ BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const
|
|||
S32 i;
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "%02x ", value[i]); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%02x ", value[i]); /* Flawfinder: ignore */
|
||||
*mOutputStream << buffer;
|
||||
}
|
||||
*mOutputStream << "\n";
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void LLHost::getString(char* buffer, S32 length) const
|
|||
return;
|
||||
}
|
||||
|
||||
snprintf(buffer, length, "%s:%u", u32_to_ip_string(mIP), mPort); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, length, "%s:%u", u32_to_ip_string(mIP), mPort); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
void LLHost::getIPString(char* buffer, S32 length) const
|
||||
|
|
@ -62,7 +62,7 @@ void LLHost::getIPString(char* buffer, S32 length) const
|
|||
return;
|
||||
}
|
||||
|
||||
snprintf(buffer, length, "%s", u32_to_ip_string(mIP)); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, length, "%s", u32_to_ip_string(mIP)); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
|
|||
char uuid_str[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
req->getUUID().toString(uuid_str);
|
||||
std::string base_url = getBaseURL(req->getUUID(), req->getType());
|
||||
snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", base_url.c_str() , uuid_str, LLAssetType::lookup(req->getType())); /*Flawfinder: ignore*/
|
||||
snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", base_url.c_str() , uuid_str, LLAssetType::lookup(req->getType())); /* Flawfinder: ignore */
|
||||
|
||||
LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(),
|
||||
req->getType(), RT_DOWNLOAD, tmp_url, mCurlMultiHandle);
|
||||
|
|
@ -707,7 +707,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
|
|||
char tmp_url[MAX_STRING];/*Flawfinder: ignore*/
|
||||
char uuid_str[UUID_STR_LENGTH];/*Flawfinder: ignore*/
|
||||
req->getUUID().toString(uuid_str);
|
||||
snprintf(tmp_url, sizeof(tmp_url), /*Flawfinder: ignore*/
|
||||
snprintf(tmp_url, sizeof(tmp_url), /* Flawfinder: ignore */
|
||||
do_compress ? "%s/%s.%s.gz" : "%s/%s.%s",
|
||||
mBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType()));
|
||||
|
||||
|
|
@ -762,7 +762,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
|
|||
req->getUUID().toString(uuid_str);
|
||||
|
||||
// KLW - All temporary uploads are saved locally "http://localhost:12041/asset"
|
||||
snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", mLocalBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType())); /*Flawfinder: ignore*/
|
||||
snprintf(tmp_url, sizeof(tmp_url), "%s/%36s.%s", mLocalBaseURL.c_str(), uuid_str, LLAssetType::lookup(req->getType())); /* Flawfinder: ignore */
|
||||
|
||||
LLHTTPAssetRequest *new_req = new LLHTTPAssetRequest(this, req->getUUID(),
|
||||
req->getType(), RT_LOCALUPLOAD, tmp_url, mCurlMultiHandle);
|
||||
|
|
|
|||
|
|
@ -207,8 +207,21 @@ void pack_instant_message_block(
|
|||
S32 bytes_left = MTUBYTES;
|
||||
if(message)
|
||||
{
|
||||
char buffer[MTUBYTES]; /*Flawfinder: ignore*/
|
||||
bytes_left -= snprintf(buffer, MTUBYTES, "%s", message); /*Flawfinder: ignore*/
|
||||
char buffer[MTUBYTES];
|
||||
int num_written = snprintf(buffer, MTUBYTES, "%s", message); /* Flawfinder: ignore */
|
||||
// snprintf returns number of bytes that would have been written
|
||||
// had the output not being truncated. In that case, it will
|
||||
// return either -1 or value >= passed in size value . So a check needs to be added
|
||||
// to detect truncation, and if there is any, only account for the
|
||||
// actual number of bytes written..and not what could have been
|
||||
// written.
|
||||
if (num_written < 0 || num_written >= MTUBYTES)
|
||||
{
|
||||
num_written = MTUBYTES - 1;
|
||||
llwarns << "pack_instant_message_block: message truncated: " << message << llendl;
|
||||
}
|
||||
|
||||
bytes_left -= num_written;
|
||||
bytes_left = llmax(0, bytes_left);
|
||||
msg->addStringFast(_PREHASH_Message, buffer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id,
|
|||
mRemoteHost = remote_host;
|
||||
mDeleteRemoteOnCompletion = delete_remote_on_completion;
|
||||
|
||||
snprintf(mTempFilename, sizeof(mTempFilename), "%s",gDirUtilp->getTempFilename().c_str()); /* Flawfinder : ignore */
|
||||
snprintf(mTempFilename, sizeof(mTempFilename), "%s",gDirUtilp->getTempFilename().c_str()); /* Flawfinder: ignore */
|
||||
|
||||
mCallback = callback;
|
||||
mCallbackDataHandle = user_data;
|
||||
|
|
|
|||
|
|
@ -1950,7 +1950,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
|
|||
std::ostringstream str;
|
||||
str << "MSG: <- " << host;
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "\t%6d\t%6d\t%6d ", mReceiveSize, (mIncomingCompressedSize ? mIncomingCompressedSize : mReceiveSize), mCurrentRecvPacketID);/* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "\t%6d\t%6d\t%6d ", mReceiveSize, (mIncomingCompressedSize ? mIncomingCompressedSize : mReceiveSize), mCurrentRecvPacketID); /* Flawfinder: ignore */
|
||||
str << buffer << "(unknown)"
|
||||
<< (recv_reliable ? " reliable" : "")
|
||||
<< " resent "
|
||||
|
|
@ -3224,7 +3224,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re
|
|||
std::ostringstream str;
|
||||
str << "MSG: <- " << host;
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "\t%6d\t%6d\t%6d ", mReceiveSize, (mIncomingCompressedSize ? mIncomingCompressedSize: mReceiveSize), mCurrentRecvPacketID); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "\t%6d\t%6d\t%6d ", mReceiveSize, (mIncomingCompressedSize ? mIncomingCompressedSize: mReceiveSize), mCurrentRecvPacketID); /* Flawfinder: ignore */
|
||||
str << buffer
|
||||
<< mCurrentRMessageTemplate->mName
|
||||
<< (recv_reliable ? " reliable" : "")
|
||||
|
|
@ -4771,75 +4771,75 @@ void LLMessageSystem::summarizeLogs(std::ostream& str)
|
|||
char tmp_str[MAX_STRING]; /* Flawfinder: ignore */
|
||||
F32 run_time = mMessageSystemTimer.getElapsedTimeF32();
|
||||
str << "START MESSAGE LOG SUMMARY" << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Run time: %12.3f seconds", run_time); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Run time: %12.3f seconds", run_time); /* Flawfinder: ignore */
|
||||
|
||||
// Incoming
|
||||
str << buffer << std::endl << "Incoming:" << std::endl;
|
||||
U64_to_str(mTotalBytesIn, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total bytes received: %20s (%5.2f kbits per second)", tmp_str, ((F32)mTotalBytesIn * 0.008f) / run_time); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total bytes received: %20s (%5.2f kbits per second)", tmp_str, ((F32)mTotalBytesIn * 0.008f) / run_time); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(mPacketsIn, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total packets received: %20s (%5.2f packets per second)", tmp_str, ((F32) mPacketsIn / run_time)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total packets received: %20s (%5.2f packets per second)", tmp_str, ((F32) mPacketsIn / run_time)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Average packet size: %20.0f bytes", (F32)mTotalBytesIn / (F32)mPacketsIn); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Average packet size: %20.0f bytes", (F32)mTotalBytesIn / (F32)mPacketsIn); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(mReliablePacketsIn, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total reliable packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mReliablePacketsIn)/((F32) mPacketsIn + 1)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total reliable packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mReliablePacketsIn)/((F32) mPacketsIn + 1)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(mCompressedPacketsIn, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total compressed packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mCompressedPacketsIn)/((F32) mPacketsIn + 1)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total compressed packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mCompressedPacketsIn)/((F32) mPacketsIn + 1)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
S64 savings = mUncompressedBytesIn - mCompressedBytesIn;
|
||||
U64_to_str(savings, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total compression savings: %20s bytes", tmp_str); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total compression savings: %20s bytes", tmp_str); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(savings/(mCompressedPacketsIn +1), tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Avg comp packet savings: %20s (%5.2f : 1)", tmp_str, ((F32) mUncompressedBytesIn)/((F32) mCompressedBytesIn+1)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Avg comp packet savings: %20s (%5.2f : 1)", tmp_str, ((F32) mUncompressedBytesIn)/((F32) mCompressedBytesIn+1)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(savings/(mPacketsIn+1), tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Avg overall comp savings: %20s (%5.2f : 1)", tmp_str, ((F32) mTotalBytesIn + (F32) savings)/((F32) mTotalBytesIn + 1.f)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Avg overall comp savings: %20s (%5.2f : 1)", tmp_str, ((F32) mTotalBytesIn + (F32) savings)/((F32) mTotalBytesIn + 1.f)); /* Flawfinder: ignore */
|
||||
|
||||
// Outgoing
|
||||
str << buffer << std::endl << std::endl << "Outgoing:" << std::endl;
|
||||
U64_to_str(mTotalBytesOut, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total bytes sent: %20s (%5.2f kbits per second)", tmp_str, ((F32)mTotalBytesOut * 0.008f) / run_time ); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total bytes sent: %20s (%5.2f kbits per second)", tmp_str, ((F32)mTotalBytesOut * 0.008f) / run_time ); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(mPacketsOut, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total packets sent: %20s (%5.2f packets per second)", tmp_str, ((F32)mPacketsOut / run_time)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total packets sent: %20s (%5.2f packets per second)", tmp_str, ((F32)mPacketsOut / run_time)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Average packet size: %20.0f bytes", (F32)mTotalBytesOut / (F32)mPacketsOut); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Average packet size: %20.0f bytes", (F32)mTotalBytesOut / (F32)mPacketsOut); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(mReliablePacketsOut, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total reliable packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mReliablePacketsOut)/((F32) mPacketsOut + 1)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total reliable packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mReliablePacketsOut)/((F32) mPacketsOut + 1)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(mCompressedPacketsOut, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total compressed packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mCompressedPacketsOut)/((F32) mPacketsOut + 1)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total compressed packets: %20s (%5.2f%%)", tmp_str, 100.f * ((F32) mCompressedPacketsOut)/((F32) mPacketsOut + 1)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
savings = mUncompressedBytesOut - mCompressedBytesOut;
|
||||
U64_to_str(savings, tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Total compression savings: %20s bytes", tmp_str); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Total compression savings: %20s bytes", tmp_str); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(savings/(mCompressedPacketsOut +1), tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Avg comp packet savings: %20s (%5.2f : 1)", tmp_str, ((F32) mUncompressedBytesOut)/((F32) mCompressedBytesOut+1)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Avg comp packet savings: %20s (%5.2f : 1)", tmp_str, ((F32) mUncompressedBytesOut)/((F32) mCompressedBytesOut+1)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
U64_to_str(savings/(mPacketsOut+1), tmp_str, sizeof(tmp_str));
|
||||
snprintf(buffer, MAX_STRING, "Avg overall comp savings: %20s (%5.2f : 1)", tmp_str, ((F32) mTotalBytesOut + (F32) savings)/((F32) mTotalBytesOut + 1.f)); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Avg overall comp savings: %20s (%5.2f : 1)", tmp_str, ((F32) mTotalBytesOut + (F32) savings)/((F32) mTotalBytesOut + 1.f)); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "SendPacket failures: %20d", mSendPacketFailureCount); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "SendPacket failures: %20d", mSendPacketFailureCount); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Dropped packets: %20d", mDroppedPackets); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Dropped packets: %20d", mDroppedPackets); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Resent packets: %20d", mResentPackets); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Resent packets: %20d", mResentPackets); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Failed reliable resends: %20d", mFailedResendPackets); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Failed reliable resends: %20d", mFailedResendPackets); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "Off-circuit rejected packets: %17d", mOffCircuitPackets); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "Off-circuit rejected packets: %17d", mOffCircuitPackets); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "On-circuit invalid packets: %17d", mInvalidOnCircuitPackets); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "On-circuit invalid packets: %17d", mInvalidOnCircuitPackets); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl << std::endl;
|
||||
|
||||
str << "Decoding: " << std::endl;
|
||||
snprintf(buffer, MAX_STRING, "%35s%10s%10s%10s%10s", "Message", "Count", "Time", "Max", "Avg"); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%35s%10s%10s%10s%10s", "Message", "Count", "Time", "Max", "Avg"); /* Flawfinder: ignore */
|
||||
str << buffer << std:: endl;
|
||||
F32 avg;
|
||||
for (message_template_name_map_t::iterator iter = mMessageTemplates.begin(),
|
||||
|
|
@ -4850,7 +4850,7 @@ void LLMessageSystem::summarizeLogs(std::ostream& str)
|
|||
if(mt->mTotalDecoded > 0)
|
||||
{
|
||||
avg = mt->mTotalDecodeTime / (F32)mt->mTotalDecoded;
|
||||
snprintf(buffer, MAX_STRING, "%35s%10u%10f%10f%10f", mt->mName, mt->mTotalDecoded, mt->mTotalDecodeTime, mt->mMaxDecodeTimePerMsg, avg); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%35s%10u%10f%10f%10f", mt->mName, mt->mTotalDecoded, mt->mTotalDecodeTime, mt->mMaxDecodeTimePerMsg, avg); /* Flawfinder: ignore */
|
||||
str << buffer << std::endl;
|
||||
}
|
||||
}
|
||||
|
|
@ -5565,7 +5565,7 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs(
|
|||
|
||||
d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */
|
||||
|
||||
snprintf(tbuf, sizeof(tbuf),"%i", number); /* Flawfinder: ignore */
|
||||
snprintf(tbuf, sizeof(tbuf),"%i", number); /* Flawfinder: ignore */
|
||||
d.update((unsigned char *) tbuf, (U32)strlen(tbuf)); /* Flawfinder: ignore */
|
||||
|
||||
d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */
|
||||
|
|
@ -5824,7 +5824,7 @@ void LLMessageSystem::dumpPacketToLog()
|
|||
S32 cur_line = 0;
|
||||
for (i = 0; i < mTrueReceiveSize; i++)
|
||||
{
|
||||
snprintf(line_buffer + cur_line_pos*3, sizeof(line_buffer),"%02x ", mTrueReceiveBuffer[i]); /* Flawfinder: ignore */
|
||||
snprintf(line_buffer + cur_line_pos*3, sizeof(line_buffer),"%02x ", mTrueReceiveBuffer[i]); /* Flawfinder: ignore */
|
||||
cur_line_pos++;
|
||||
if (cur_line_pos >= 16)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
|
|||
snprintf(pcode_string, sizeof(pcode_string), "text bubble"); /* Flawfinder: ignore */
|
||||
break;
|
||||
case LL_PCODE_LEGACY_TREE:
|
||||
snprintf(pcode_string, sizeof(pcode_string), "tree"); /* Flawfinder: ignore */
|
||||
snprintf(pcode_string, sizeof(pcode_string), "tree"); /* Flawfinder: ignore */
|
||||
break;
|
||||
case LL_PCODE_TREE_NEW:
|
||||
snprintf(pcode_string, sizeof(pcode_string), "tree_new"); /* Flawfinder: ignore */
|
||||
|
|
@ -745,23 +745,23 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
|
|||
}
|
||||
else if (base_code == LL_PCODE_PYRAMID)
|
||||
{
|
||||
snprintf(shape, sizeof(shape), "pyramid"); /* Flawfinder: ignore */
|
||||
snprintf(shape, sizeof(shape), "pyramid"); /* Flawfinder: ignore */
|
||||
}
|
||||
else if (base_code == LL_PCODE_SPHERE)
|
||||
{
|
||||
snprintf(shape, sizeof(shape), "sphere"); /* Flawfinder: ignore */
|
||||
snprintf(shape, sizeof(shape), "sphere"); /* Flawfinder: ignore */
|
||||
}
|
||||
else if (base_code == LL_PCODE_TETRAHEDRON)
|
||||
{
|
||||
snprintf(shape, sizeof(shape), "tetrahedron"); /* Flawfinder: ignore */
|
||||
snprintf(shape, sizeof(shape), "tetrahedron"); /* Flawfinder: ignore */
|
||||
}
|
||||
else if (base_code == LL_PCODE_VOLUME)
|
||||
{
|
||||
snprintf(shape, sizeof(shape), "volume"); /* Flawfinder: ignore */
|
||||
snprintf(shape, sizeof(shape), "volume"); /* Flawfinder: ignore */
|
||||
}
|
||||
else if (base_code == LL_PCODE_APP)
|
||||
{
|
||||
snprintf(shape, sizeof(shape), "app"); /* Flawfinder: ignore */
|
||||
snprintf(shape, sizeof(shape), "app"); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -771,15 +771,15 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
|
|||
U8 mask_code = pcode & (~LL_PCODE_BASE_MASK);
|
||||
if (base_code == LL_PCODE_APP)
|
||||
{
|
||||
snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
|
||||
snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
|
||||
}
|
||||
else if (mask_code & LL_PCODE_HEMI_MASK)
|
||||
{
|
||||
snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */
|
||||
snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */
|
||||
}
|
||||
else if (mask != 0)
|
||||
{
|
||||
snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
|
||||
snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -788,11 +788,11 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode)
|
|||
|
||||
if (mask[0])
|
||||
{
|
||||
snprintf(pcode_string, sizeof(pcode_string), "%s-%s", shape, mask); /* Flawfinder: ignore */
|
||||
snprintf(pcode_string, sizeof(pcode_string), "%s-%s", shape, mask); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */
|
||||
snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */
|
||||
}
|
||||
}
|
||||
return pcode_string;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ char *fv3(F32 *f)
|
|||
char *fv1(F32 *f)
|
||||
{
|
||||
static char str[128]; /* Flawfinder: ignore */
|
||||
snprintf(str, sizeof(str), "%8.3f", f[0]); /* Flawfinder: ignore */
|
||||
snprintf(str, sizeof(str), "%8.3f", f[0]); /* Flawfinder: ignore */
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ LLDir_Linux::LLDir_Linux()
|
|||
// *NOTE: /proc/%d/exe doesn't work on FreeBSD. But that's ok,
|
||||
// because this is the linux implementation.
|
||||
|
||||
snprintf (path, sizeof(path), "/proc/%d/exe", (int) getpid ()); /* Flawfinder: ignore */
|
||||
snprintf (path, sizeof(path), "/proc/%d/exe", (int) getpid ());
|
||||
int rc = readlink (path, tmp_str, sizeof (tmp_str)-1); /* Flawfinder: ignore */
|
||||
if ( (rc != -1) && (rc <= ((int) sizeof (tmp_str)-1)) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card)
|
|||
if (!strnicmp(RENDERER, bad_card, strlen(bad_card)))
|
||||
{
|
||||
char buffer[1024];/* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"Your video card appears to be a %s, which Second Life does not support.\n"
|
||||
"\n"
|
||||
"Second Life requires a video card with 32 Mb of memory or more, as well as\n"
|
||||
|
|
@ -407,7 +407,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
|
|||
mFullscreenRefresh = -1;
|
||||
|
||||
char error[256]; /* Flawfinder: ignore */
|
||||
snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */
|
||||
snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height);
|
||||
OSMessageBox(error, "Error", OSMB_OK);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card)
|
|||
if (!strncasecmp(RENDERER, bad_card, strlen(bad_card)))
|
||||
{
|
||||
char buffer[1024]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"Your video card appears to be a %s, which Second Life does not support.\n"
|
||||
"\n"
|
||||
"Second Life requires a video card with 32 Mb of memory or more, as well as\n"
|
||||
|
|
@ -295,7 +295,7 @@ static SDL_Surface *Load_BMP_Resource(const char *basename)
|
|||
char path_buffer[PATH_BUFFER_SIZE]; /* Flawfinder: ignore */
|
||||
|
||||
// Figure out where our BMP is living on the disk
|
||||
snprintf(path_buffer, PATH_BUFFER_SIZE-1, "%s%sres-sdl%s%s", /* Flawfinder: ignore */
|
||||
snprintf(path_buffer, PATH_BUFFER_SIZE-1, "%s%sres-sdl%s%s",
|
||||
gDirUtilp->getAppRODataDir().c_str(),
|
||||
gDirUtilp->getDirDelimiter().c_str(),
|
||||
gDirUtilp->getDirDelimiter().c_str(),
|
||||
|
|
@ -466,7 +466,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
mFullscreenRefresh = -1;
|
||||
|
||||
char error[256]; /* Flawfinder: ignore */
|
||||
snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); /* Flawfinder: ignore */
|
||||
snprintf(error, sizeof(error), "Unable to run fullscreen at %d x %d.\nRunning in window.", width, height);
|
||||
OSMessageBox(error, "Error", OSMB_OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1165,7 +1165,7 @@ x11clipboard_type convert_format(int type)
|
|||
these right now, and support is skeletal. */
|
||||
char format[sizeof(FORMAT_PREFIX)+8+1]; /* Flawfinder: ignore */
|
||||
|
||||
snprintf(format, sizeof(format), "%s%08lx", FORMAT_PREFIX, (unsigned long)type); /* Flawfinder: ignore */
|
||||
snprintf(format, sizeof(format), "%s%08lx", FORMAT_PREFIX, (unsigned long)type);
|
||||
return XInternAtom(gWindowImplementation->mSDL_Display,
|
||||
format, False);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2143,7 +2143,7 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
|
|||
{
|
||||
precision = 25;
|
||||
}
|
||||
snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
|
||||
snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2194,7 +2194,7 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
|
|||
{
|
||||
precision = 25;
|
||||
}
|
||||
snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
|
||||
snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
|
|||
FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
|
||||
if( !file )
|
||||
{
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
|
|
@ -71,7 +71,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
|
|||
void* buffer = XML_GetBuffer(mParser, buffer_size);
|
||||
if( !buffer )
|
||||
{
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */
|
||||
success = FALSE;
|
||||
goto exit_label;
|
||||
}
|
||||
|
|
@ -79,14 +79,14 @@ BOOL LLXmlParser::parseFile(const std::string &path)
|
|||
bytes_read = (S32)fread(buffer, 1, buffer_size, file);
|
||||
if( bytes_read <= 0 )
|
||||
{
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */
|
||||
success = FALSE;
|
||||
goto exit_label;
|
||||
}
|
||||
|
||||
if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
|
||||
{
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */
|
||||
snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7967,7 +7967,7 @@ void LLScriptIf::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pas
|
|||
case LSCP_EMIT_BYTE_CODE:
|
||||
{
|
||||
char jumpname[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname, sizeof(jumpname),"##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname, sizeof(jumpname),"##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
|
||||
mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
|
||||
chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]);
|
||||
|
|
@ -8048,9 +8048,9 @@ void LLScriptIfElse::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
|
|||
case LSCP_EMIT_BYTE_CODE:
|
||||
{
|
||||
char jumpname1[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
char jumpname2[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
|
||||
mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
|
||||
chunk->addByte(LSCRIPTOpCodes[LOPC_JUMPNIF]);
|
||||
|
|
@ -8151,9 +8151,9 @@ void LLScriptFor::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pa
|
|||
case LSCP_EMIT_BYTE_CODE:
|
||||
{
|
||||
char jumpname1[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
char jumpname2[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
|
||||
if(mSequence)
|
||||
mSequence->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
|
||||
|
|
@ -8248,7 +8248,7 @@ void LLScriptDoWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePas
|
|||
case LSCP_EMIT_BYTE_CODE:
|
||||
{
|
||||
char jumpname1[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
|
||||
chunk->addLabel(jumpname1);
|
||||
mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
|
||||
|
|
@ -8322,9 +8322,9 @@ void LLScriptWhile::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass
|
|||
case LSCP_EMIT_BYTE_CODE:
|
||||
{
|
||||
char jumpname1[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname1, sizeof(jumpname1), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
char jumpname2[32]; /*Flawfinder: ignore*/
|
||||
snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /*Flawfinder: ignore*/
|
||||
snprintf(jumpname2, sizeof(jumpname2), "##Temp Jump %d##", gTempJumpCount++); /* Flawfinder: ignore */
|
||||
|
||||
chunk->addLabel(jumpname1);
|
||||
mExpression->recurse(fp, tabs, tabsize, LSCP_TO_STACK, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
|
||||
|
|
|
|||
|
|
@ -2996,7 +2996,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
|
|||
case LST_STRING:
|
||||
{
|
||||
S32 address, source = lscript_pop_int(buffer);
|
||||
snprintf(caststr, sizeof(caststr), "%d", source); /*Flawfinder: ignore*/
|
||||
snprintf(caststr, sizeof(caststr), "%d", source); /* Flawfinder: ignore */
|
||||
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
|
||||
lscript_push(buffer, address);
|
||||
}
|
||||
|
|
@ -3033,7 +3033,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
|
|||
{
|
||||
S32 address;
|
||||
F32 source = lscript_pop_float(buffer);
|
||||
snprintf(caststr, sizeof(caststr), "%f", source); /*Flawfinder: ignore*/
|
||||
snprintf(caststr, sizeof(caststr), "%f", source); /* Flawfinder: ignore */
|
||||
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
|
||||
lscript_push(buffer, address);
|
||||
}
|
||||
|
|
@ -3242,7 +3242,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
|
|||
S32 address;
|
||||
LLVector3 source;
|
||||
lscript_pop_vector(buffer, source);
|
||||
snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f>", source.mV[VX], source.mV[VY], source.mV[VZ]); /*Flawfinder: ignore*/
|
||||
snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f>", source.mV[VX], source.mV[VY], source.mV[VZ]); /* Flawfinder: ignore */
|
||||
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
|
||||
lscript_push(buffer, address);
|
||||
}
|
||||
|
|
@ -3275,7 +3275,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
|
|||
S32 address;
|
||||
LLQuaternion source;
|
||||
lscript_pop_quaternion(buffer, source);
|
||||
snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f, %5.5f>", source.mQ[VX], source.mQ[VY], source.mQ[VZ], source.mQ[VS]); /*Flawfinder: ignore*/
|
||||
snprintf(caststr, sizeof(caststr), "<%5.5f, %5.5f, %5.5f, %5.5f>", source.mQ[VX], source.mQ[VY], source.mQ[VZ], source.mQ[VS]); /* Flawfinder: ignore */
|
||||
address = lsa_heap_add_data(buffer, new LLScriptLibData(caststr), get_max_heap_size(buffer), TRUE);
|
||||
lscript_push(buffer, address);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
|
|||
s << mInteger;
|
||||
break;
|
||||
case LST_FLOATINGPOINT:
|
||||
snprintf(tmp, 1024, "%f", mFP); /*Flawfinder: ignore*/
|
||||
snprintf(tmp, 1024, "%f", mFP); /* Flawfinder: ignore */
|
||||
s << tmp;
|
||||
break;
|
||||
case LST_KEY:
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ int main(int argc, char **argv)
|
|||
llinfos << "Starting " << gProductName << " Updater" << llendl;
|
||||
|
||||
// Build the URL to download the update
|
||||
snprintf(gUpdateURL, sizeof(gUpdateURL), "http://secondlife.com/update-macos.php?userserver=%s", gUserServer); /* Flawfinder: ignore */
|
||||
snprintf(gUpdateURL, sizeof(gUpdateURL), "http://secondlife.com/update-macos.php?userserver=%s", gUserServer);
|
||||
|
||||
// Real UI...
|
||||
OSStatus err;
|
||||
|
|
@ -371,7 +371,7 @@ int main(int argc, char **argv)
|
|||
err = CreateNibReference(CFSTR("AutoUpdater"), &nib);
|
||||
|
||||
char windowTitle[MAX_PATH]; /* Flawfinder: ignore */
|
||||
snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); /* Flawfinder: ignore */
|
||||
snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName);
|
||||
CFStringRef windowTitleRef = NULL;
|
||||
windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8);
|
||||
|
||||
|
|
@ -545,8 +545,8 @@ int restoreObject(const char* aside, const char* target, const char* path, const
|
|||
{
|
||||
char source[PATH_MAX]; /* Flawfinder: ignore */
|
||||
char dest[PATH_MAX]; /* Flawfinder: ignore */
|
||||
snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); /* Flawfinder: ignore */
|
||||
snprintf(dest, sizeof(dest), "%s/%s", target, path); /* Flawfinder: ignore */
|
||||
snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object);
|
||||
snprintf(dest, sizeof(dest), "%s/%s", target, path);
|
||||
FSRef sourceRef;
|
||||
FSRef destRef;
|
||||
OSStatus err;
|
||||
|
|
@ -580,11 +580,11 @@ void filterFile(const char* filename)
|
|||
{
|
||||
char temp[PATH_MAX]; /* Flawfinder: ignore */
|
||||
// First copy the target's version, so we can run it through sed.
|
||||
snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename);
|
||||
system(temp); /* Flawfinder: ignore */
|
||||
|
||||
// Now run it through sed.
|
||||
snprintf(temp, sizeof(temp), /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp),
|
||||
"sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename);
|
||||
system(temp); /* Flawfinder: ignore */
|
||||
}
|
||||
|
|
@ -740,7 +740,7 @@ void *updatethreadproc(void*)
|
|||
throw 0;
|
||||
}
|
||||
|
||||
snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); /* Flawfinder: ignore */
|
||||
snprintf(target, sizeof(target), "/Applications/%s.app", gProductName);
|
||||
|
||||
memset(&targetRef, 0, sizeof(targetRef));
|
||||
err = FSPathMakeRef((UInt8*)target, &targetRef, NULL);
|
||||
|
|
@ -836,7 +836,7 @@ void *updatethreadproc(void*)
|
|||
|
||||
chdir(tempDir);
|
||||
|
||||
snprintf(temp, sizeof(temp), "SecondLife.dmg"); /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp), "SecondLife.dmg");
|
||||
|
||||
downloadFile = fopen(temp, "wb"); /* Flawfinder: ignore */
|
||||
if(downloadFile == NULL)
|
||||
|
|
@ -934,7 +934,7 @@ void *updatethreadproc(void*)
|
|||
|
||||
// Get an FSRef to the new application on the disk image
|
||||
FSRef sourceRef;
|
||||
snprintf(temp, sizeof(temp), "%s/mnt/Second Life.app", tempDir); /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp), "%s/mnt/Second Life.app", tempDir);
|
||||
|
||||
llinfos << "Source application is: " << temp << llendl;
|
||||
|
||||
|
|
@ -967,7 +967,7 @@ void *updatethreadproc(void*)
|
|||
{
|
||||
// Construct the name of the target based on the product name
|
||||
char appName[MAX_PATH]; /* Flawfinder: ignore */
|
||||
snprintf(appName, sizeof(appName), "%s.app", gProductName); /* Flawfinder: ignore */
|
||||
snprintf(appName, sizeof(appName), "%s.app", gProductName);
|
||||
utf8str_to_HFSUniStr255( &appNameUniStr, appName );
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1016,7 @@ void *updatethreadproc(void*)
|
|||
llinfos << "Clearing cache..." << llendl;
|
||||
|
||||
char mask[LL_MAX_PATH]; /* Flawfinder: ignore */
|
||||
snprintf(mask, LL_MAX_PATH, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); /* Flawfinder: ignore */
|
||||
snprintf(mask, LL_MAX_PATH, "%s*.*", gDirUtilp->getDirDelimiter().c_str());
|
||||
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask);
|
||||
|
||||
llinfos << "Clear complete." << llendl;
|
||||
|
|
@ -1048,7 +1048,7 @@ void *updatethreadproc(void*)
|
|||
{
|
||||
llinfos << "Detaching disk image." << llendl;
|
||||
|
||||
snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode);
|
||||
system(temp); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
|
|
@ -1073,12 +1073,12 @@ void *updatethreadproc(void*)
|
|||
{
|
||||
llinfos << "Touching application bundle." << llendl;
|
||||
|
||||
snprintf(temp, sizeof(temp), "touch '%s'", target); /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp), "touch '%s'", target);
|
||||
system(temp); /* Flawfinder: ignore */
|
||||
|
||||
llinfos << "Launching updated application." << llendl;
|
||||
|
||||
snprintf(temp, sizeof(temp), "open '%s'", target); /* Flawfinder: ignore */
|
||||
snprintf(temp, sizeof(temp), "open '%s'", target);
|
||||
system(temp); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ BOOL LLFloaterScriptQueue::start()
|
|||
{
|
||||
//llinfos << "LLFloaterCompileQueue::start()" << llendl;
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Starting %s of %d items.", mStartString, mObjectIDs.count()); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Starting %s of %d items.", mStartString, mObjectIDs.count()); /* Flawfinder: ignore */
|
||||
|
||||
LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
|
||||
list->addSimpleItem(buffer);
|
||||
|
|
@ -219,7 +219,7 @@ BOOL LLFloaterScriptQueue::nextObject()
|
|||
|
||||
mDone = TRUE;
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Done."); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Done."); /* Flawfinder: ignore */
|
||||
list->addSimpleItem(buffer);
|
||||
childSetEnabled("close",TRUE);
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
|||
LLVFile file(vfs, asset_id, type);
|
||||
char uuid_str[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
asset_id.toString(uuid_str);
|
||||
snprintf(filename, sizeof(filename), "%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /*Flawfinder: ignore*/
|
||||
snprintf(filename, sizeof(filename), "%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */
|
||||
|
||||
FILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
|
||||
if (fp)
|
||||
|
|
@ -384,7 +384,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
|||
}
|
||||
|
||||
// It's now in the file, now compile it.
|
||||
snprintf(buffer, sizeof(buffer), "Downloaded, now compiling '%s'.", data->mScriptName.c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Downloaded, now compiling '%s'.", data->mScriptName.c_str()); /* Flawfinder: ignore */
|
||||
queue->compile(filename, asset_id);
|
||||
|
||||
// Delete it after we're done compiling?
|
||||
|
|
@ -401,19 +401,19 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
|||
{
|
||||
LLChat chat("Script not found on server.");
|
||||
LLFloaterChat::addChat(chat);
|
||||
snprintf(buffer, sizeof(buffer), "Problem downloading %s.", /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Problem downloading %s.", /* Flawfinder: ignore */
|
||||
data->mScriptName.c_str());
|
||||
}
|
||||
else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status)
|
||||
{
|
||||
LLChat chat("Insufficient permissions to download a script.");
|
||||
LLFloaterChat::addChat(chat);
|
||||
snprintf(buffer, sizeof(buffer), "Insufficient permissions for '%s'.", /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Insufficient permissions for '%s'.", /* Flawfinder: ignore */
|
||||
data->mScriptName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Unknown failure to download %s.", /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Unknown failure to download %s.", /* Flawfinder: ignore */
|
||||
data->mScriptName.c_str());
|
||||
}
|
||||
|
||||
|
|
@ -477,9 +477,9 @@ void LLFloaterCompileQueue::compile(const char* filename,
|
|||
char uuid_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
new_asset_id.toString(uuid_string);
|
||||
char dst_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
snprintf(dst_filename, sizeof(dst_filename), "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(dst_filename, sizeof(dst_filename), "%s.lso", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /* Flawfinder: ignore */
|
||||
char err_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
snprintf(err_filename, sizeof(err_filename), "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(err_filename, sizeof(err_filename), "%s.out", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /* Flawfinder: ignore */
|
||||
|
||||
gAssetStorage->storeAssetData(filename, tid,
|
||||
LLAssetType::AT_LSL_TEXT,
|
||||
|
|
@ -603,7 +603,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj,
|
|||
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
|
||||
LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Resetting '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Resetting '%s'.", item->getName().c_str()); /* Flawfinder: ignore */
|
||||
list->addSimpleItem(buffer);
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_ScriptReset);
|
||||
|
|
@ -666,7 +666,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj,
|
|||
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
|
||||
LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Running '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Running '%s'.", item->getName().c_str()); /* Flawfinder: ignore */
|
||||
list->addSimpleItem(buffer);
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
|
@ -731,7 +731,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
|
|||
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
|
||||
LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output");
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Not running '%s'.", item->getName().c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Not running '%s'.", item->getName().c_str()); /* Flawfinder: ignore */
|
||||
list->addSimpleItem(buffer);
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
|
|
|||
|
|
@ -191,14 +191,14 @@ void LLDebugVarMessageBox::draw()
|
|||
switch(mVarType)
|
||||
{
|
||||
case VAR_TYPE_F32:
|
||||
snprintf(text, sizeof(text), "%.3f", *((F32*)mVarData)); /*Flawfinder: ignore*/
|
||||
snprintf(text, sizeof(text), "%.3f", *((F32*)mVarData)); /* Flawfinder: ignore */
|
||||
break;
|
||||
case VAR_TYPE_S32:
|
||||
snprintf(text, sizeof(text), "%d", *((S32*)mVarData)); /*Flawfinder: ignore*/
|
||||
snprintf(text, sizeof(text), "%d", *((S32*)mVarData)); /* Flawfinder: ignore */
|
||||
break;
|
||||
case VAR_TYPE_VEC3:
|
||||
LLVector3* vec_p = (LLVector3*)mVarData;
|
||||
snprintf(text, sizeof(text), "%.3f %.3f %.3f", vec_p->mV[VX], vec_p->mV[VY], vec_p->mV[VZ]); /*Flawfinder: ignore*/
|
||||
snprintf(text, sizeof(text), "%.3f %.3f %.3f", vec_p->mV[VX], vec_p->mV[VY], vec_p->mV[VZ]); /* Flawfinder: ignore */
|
||||
break;
|
||||
}
|
||||
mText->setText(text);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ BOOL LLFloaterAnimPreview::postBuild()
|
|||
childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration()));
|
||||
mEnabled = TRUE;
|
||||
char seconds_string[128]; /*Flawfinder: ignore*/
|
||||
snprintf(seconds_string, sizeof(seconds_string), " - %.2f seconds", motionp->getDuration()); /*Flawfinder: ignore*/
|
||||
snprintf(seconds_string, sizeof(seconds_string), " - %.2f seconds", motionp->getDuration()); /* Flawfinder: ignore */
|
||||
|
||||
setTitle(mFilename + LLString(seconds_string));
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ BOOL LLFloaterAnimPreview::postBuild()
|
|||
{
|
||||
char output_str[256]; /*Flawfinder: ignore*/
|
||||
|
||||
snprintf(output_str, sizeof(output_str), "Animation file is %.1f seconds in length.\n\nMaximum animation length is %.1f seconds.\n", /*Flawfinder: ignore*/
|
||||
snprintf(output_str, sizeof(output_str), "Animation file is %.1f seconds in length.\n\nMaximum animation length is %.1f seconds.\n", /* Flawfinder: ignore */
|
||||
loaderp->getDuration(), MAX_ANIM_DURATION);
|
||||
childSetValue("bad_animation_text", LLSD(output_str));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ void LLPanelLandGeneral::refresh()
|
|||
else if(parcel->getAuctionID())
|
||||
{
|
||||
char auction_str[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(auction_str, sizeof(auction_str), "Auction ID: %u", parcel->getAuctionID()); /*Flawfinder: ignore*/
|
||||
snprintf(auction_str, sizeof(auction_str), "Auction ID: %u", parcel->getAuctionID()); /* Flawfinder: ignore */
|
||||
mTextSalePending->setText(auction_str);
|
||||
mTextSalePending->setEnabled(TRUE);
|
||||
}
|
||||
|
|
@ -710,13 +710,13 @@ void LLPanelLandGeneral::refresh()
|
|||
&dwell);
|
||||
|
||||
// Area
|
||||
snprintf(price, sizeof(price), "%d sq. m.", area); /*Flawfinder: ignore*/
|
||||
snprintf(price, sizeof(price), "%d sq. m.", area); /* Flawfinder: ignore */
|
||||
label = AREA;
|
||||
|
||||
mTextPriceLabel->setText(label);
|
||||
mTextPrice->setText(price);
|
||||
|
||||
snprintf(price, sizeof(price), "%.0f", dwell); /*Flawfinder: ignore*/
|
||||
snprintf(price, sizeof(price), "%.0f", dwell); /* Flawfinder: ignore */
|
||||
mTextDwell->setText(price);
|
||||
|
||||
if(region_owner)
|
||||
|
|
@ -761,7 +761,7 @@ void LLPanelLandGeneral::refreshNames()
|
|||
char owner_first[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
char owner_last[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
gCacheName->getName(parcel->getOwnerID(), owner_first, owner_last);
|
||||
snprintf(buffer, sizeof(buffer), "%s %s", owner_first, owner_last); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%s %s", owner_first, owner_last); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus())
|
||||
|
|
@ -922,8 +922,8 @@ void LLPanelLandGeneral::onClickBuyPass(void* data)
|
|||
F32 pass_hours = parcel->getPassHours();
|
||||
|
||||
char cost[256], time[256]; /*Flawfinder: ignore*/
|
||||
snprintf(cost, sizeof(cost), "%d", pass_price); /*Flawfinder: ignore*/
|
||||
snprintf(time, sizeof(time), "%.2f", pass_hours); /*Flawfinder: ignore*/
|
||||
snprintf(cost, sizeof(cost), "%d", pass_price); /* Flawfinder: ignore */
|
||||
snprintf(time, sizeof(time), "%.2f", pass_hours); /* Flawfinder: ignore */
|
||||
|
||||
LLStringBase<char>::format_map_t args;
|
||||
args["[COST]"] = cost;
|
||||
|
|
@ -1247,7 +1247,7 @@ void LLPanelLandObjects::refresh()
|
|||
|
||||
if (parcel_object_bonus != 1.0f)
|
||||
{
|
||||
snprintf(count, sizeof(count), "Region Object Bonus Factor: %.2f", /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "Region Object Bonus Factor: %.2f", /* Flawfinder: ignore */
|
||||
parcel_object_bonus);
|
||||
mParcelObjectBonus->setText(count);
|
||||
}
|
||||
|
|
@ -1258,35 +1258,35 @@ void LLPanelLandObjects::refresh()
|
|||
|
||||
if (sw_total > sw_max)
|
||||
{
|
||||
snprintf(count, sizeof(count), "%d out of %d (%d will be deleted)", /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d out of %d (%d will be deleted)", /* Flawfinder: ignore */
|
||||
sw_total, sw_max, sw_total - sw_max);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(count, sizeof(count), "%d out of %d (%d available)", /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d out of %d (%d available)", /* Flawfinder: ignore */
|
||||
sw_total, sw_max, sw_max - sw_total);
|
||||
}
|
||||
mSWTotalObjects->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", max); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", max); /* Flawfinder: ignore */
|
||||
mObjectContribution->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", total); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", total); /* Flawfinder: ignore */
|
||||
mTotalObjects->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", owned); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", owned); /* Flawfinder: ignore */
|
||||
mOwnerObjects->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", group); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", group); /* Flawfinder: ignore */
|
||||
mGroupObjects->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", other); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", other); /* Flawfinder: ignore */
|
||||
mOtherObjects->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", selected); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", selected); /* Flawfinder: ignore */
|
||||
mSelectedObjects->setText(count);
|
||||
|
||||
snprintf(count, sizeof(count), "%d", mOtherTime); /*Flawfinder: ignore*/
|
||||
snprintf(count, sizeof(count), "%d", mOtherTime); /* Flawfinder: ignore */
|
||||
mCleanOtherObjectsTime->setText(count);
|
||||
|
||||
BOOL can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED);
|
||||
|
|
@ -1617,7 +1617,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
|
|||
// Placeholder for name.
|
||||
row->addColumn("", FONT, self->mColWidth[2]);
|
||||
|
||||
snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /*Flawfinder: ignore*/
|
||||
snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /* Flawfinder: ignore */
|
||||
row->addColumn(object_count_str, FONT, self->mColWidth[3]);
|
||||
|
||||
if (is_group_owned)
|
||||
|
|
@ -2175,7 +2175,7 @@ void LLPanelLandOptions::refresh()
|
|||
else
|
||||
{
|
||||
char buffer[256]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Landing Point: %d, %d, %d", /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Landing Point: %d, %d, %d", /* Flawfinder: ignore */
|
||||
llround(pos.mV[VX]),
|
||||
llround(pos.mV[VY]),
|
||||
llround(pos.mV[VZ]));
|
||||
|
|
@ -2559,14 +2559,14 @@ void LLPanelLandAccess::refresh()
|
|||
|
||||
char group_name[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
gCacheName->getGroupName(parcel->getGroupID(), group_name);
|
||||
snprintf(label, sizeof(label), "Group: %s", group_name); /*Flawfinder: ignore*/
|
||||
snprintf(label, sizeof(label), "Group: %s", group_name); /* Flawfinder: ignore */
|
||||
mCheckGroup->setLabel( label );
|
||||
|
||||
S32 count = parcel->mAccessList.size();
|
||||
|
||||
BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST);
|
||||
mCheckAccess->set( use_list );
|
||||
snprintf(label, sizeof(label), "Avatars: (%d listed, %d max)", /*Flawfinder: ignore*/
|
||||
snprintf(label, sizeof(label), "Avatars: (%d listed, %d max)", /* Flawfinder: ignore */
|
||||
count, PARCEL_MAX_ACCESS_LIST);
|
||||
mCheckAccess->setLabel( label );
|
||||
|
||||
|
|
@ -2586,7 +2586,7 @@ void LLPanelLandAccess::refresh()
|
|||
if (seconds >= 120)
|
||||
{
|
||||
char buf[30]; /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /* Flawfinder: ignore */
|
||||
suffix.append(buf);
|
||||
}
|
||||
else if (seconds >= 60)
|
||||
|
|
@ -2596,7 +2596,7 @@ void LLPanelLandAccess::refresh()
|
|||
else
|
||||
{
|
||||
char buf[30]; /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d seconds", seconds); /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d seconds", seconds); /* Flawfinder: ignore */
|
||||
suffix.append(buf);
|
||||
}
|
||||
suffix.append(" remaining)");
|
||||
|
|
@ -2661,7 +2661,7 @@ void LLPanelLandAccess::refreshNames()
|
|||
gCacheName->getGroupName(parcel->getGroupID(), group_name);
|
||||
}
|
||||
char label[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(label, sizeof(label), "Group: %s", group_name); /*Flawfinder: ignore*/
|
||||
snprintf(label, sizeof(label), "Group: %s", group_name); /* Flawfinder: ignore */
|
||||
mCheckGroup->setLabel(label);
|
||||
}
|
||||
|
||||
|
|
@ -2836,7 +2836,7 @@ void LLPanelLandBan::refresh()
|
|||
BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST);
|
||||
mCheck->set( use_ban );
|
||||
|
||||
snprintf(label, sizeof(label), "Ban these avatars: (%d listed, %d max)", /*Flawfinder: ignore*/
|
||||
snprintf(label, sizeof(label), "Ban these avatars: (%d listed, %d max)", /* Flawfinder: ignore */
|
||||
count, PARCEL_MAX_ACCESS_LIST);
|
||||
mCheck->setLabel( label );
|
||||
|
||||
|
|
@ -2855,7 +2855,7 @@ void LLPanelLandBan::refresh()
|
|||
if (seconds >= 120)
|
||||
{
|
||||
char buf[30]; /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /* Flawfinder: ignore */
|
||||
suffix.append(buf);
|
||||
}
|
||||
else if (seconds >= 60)
|
||||
|
|
@ -2865,7 +2865,7 @@ void LLPanelLandBan::refresh()
|
|||
else
|
||||
{
|
||||
char buf[30]; /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d seconds", seconds); /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%d seconds", seconds); /* Flawfinder: ignore */
|
||||
suffix.append(buf);
|
||||
}
|
||||
suffix.append(" remaining)");
|
||||
|
|
|
|||
|
|
@ -188,20 +188,20 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
|
|||
S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
|
||||
|
||||
char location[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /* Flawfinder: ignore */
|
||||
snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /* Flawfinder: ignore */
|
||||
|
||||
char area[MAX_STRING]; /* Flawfinder: ignore */
|
||||
if(billable_area == actual_area)
|
||||
{
|
||||
snprintf(area, MAX_STRING, "%d", billable_area); /* Flawfinder: ignore */
|
||||
snprintf(area, MAX_STRING, "%d", billable_area); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /* Flawfinder: ignore */
|
||||
snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /* Flawfinder: ignore */
|
||||
}
|
||||
|
||||
char hidden[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /* Flawfinder: ignore */
|
||||
snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /* Flawfinder: ignore */
|
||||
|
||||
LLSD element;
|
||||
element["columns"][0]["column"] = "name";
|
||||
|
|
@ -294,12 +294,12 @@ void LLFloaterLandHoldings::refreshAggregates()
|
|||
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%d sq. meters", allowed_area); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d sq. meters", allowed_area); /* Flawfinder: ignore */
|
||||
childSetValue("allowed_text", LLSD(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%d sq. meters", current_area); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d sq. meters", current_area); /* Flawfinder: ignore */
|
||||
childSetValue("current_text", LLSD(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%d sq. meters", available_area); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d sq. meters", available_area); /* Flawfinder: ignore */
|
||||
childSetValue("available_text", LLSD(buffer));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -415,27 +415,27 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||
|
||||
char perm_string[11]; /* Flawfinder: ignore */
|
||||
|
||||
snprintf(perm_string, sizeof(perm_string), "B: "); /* Flawfinder: ignore */
|
||||
snprintf(perm_string, sizeof(perm_string), "B: "); /* Flawfinder: ignore */
|
||||
mask_to_string(base_mask, perm_string+3);
|
||||
childSetText("BaseMaskDebug",perm_string);
|
||||
childSetVisible("BaseMaskDebug",TRUE);
|
||||
|
||||
snprintf(perm_string, sizeof(perm_string), "O: "); /* Flawfinder: ignore */
|
||||
snprintf(perm_string, sizeof(perm_string), "O: "); /* Flawfinder: ignore */
|
||||
mask_to_string(owner_mask, perm_string+3);
|
||||
childSetText("OwnerMaskDebug",perm_string);
|
||||
childSetVisible("OwnerMaskDebug",TRUE);
|
||||
|
||||
snprintf(perm_string, sizeof(perm_string), "G%s: ", overwrite_group ? "*" : ""); /* Flawfinder: ignore */
|
||||
snprintf(perm_string, sizeof(perm_string), "G%s: ", overwrite_group ? "*" : ""); /* Flawfinder: ignore */
|
||||
mask_to_string(group_mask, perm_string + (overwrite_group ? 4 : 3));
|
||||
childSetText("GroupMaskDebug",perm_string);
|
||||
childSetVisible("GroupMaskDebug",TRUE);
|
||||
|
||||
snprintf(perm_string, sizeof(perm_string), "E%s: ", overwrite_everyone ? "*" : ""); /* Flawfinder: ignore */
|
||||
snprintf(perm_string, sizeof(perm_string), "E%s: ", overwrite_everyone ? "*" : ""); /* Flawfinder: ignore */
|
||||
mask_to_string(everyone_mask, perm_string + (overwrite_everyone ? 4 : 3));
|
||||
childSetText("EveryoneMaskDebug",perm_string);
|
||||
childSetVisible("EveryoneMaskDebug",TRUE);
|
||||
|
||||
snprintf(perm_string, sizeof(perm_string), "N%s: ", slam_perm ? "*" : ""); /* Flawfinder: ignore */
|
||||
snprintf(perm_string, sizeof(perm_string), "N%s: ", slam_perm ? "*" : ""); /* Flawfinder: ignore */
|
||||
mask_to_string(next_owner_mask, perm_string + (slam_perm ? 4 : 3));
|
||||
childSetText("NextMaskDebug",perm_string);
|
||||
childSetVisible("NextMaskDebug",TRUE);
|
||||
|
|
@ -549,7 +549,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||
{
|
||||
radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
|
||||
char numerical_price[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(numerical_price, MAX_STRING, "%d", sale_info.getSalePrice()); /* Flawfinder: ignore */
|
||||
snprintf(numerical_price, MAX_STRING, "%d", sale_info.getSalePrice()); /* Flawfinder: ignore */
|
||||
childSetText("EditPrice",numerical_price);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -678,34 +678,34 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
|
|||
strings_t strings;
|
||||
//integers_t integers;
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
F32 value = (F32)childGetValue("agent_limit_spin").asReal();
|
||||
snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
value = (F32)childGetValue("object_bonus_spin").asReal();
|
||||
snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%f", value); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
U8 access = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str());
|
||||
snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d", (S32)access); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
|
||||
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
|
||||
|
|
@ -774,13 +774,13 @@ BOOL LLPanelRegionDebugInfo::sendUpdate()
|
|||
strings_t strings;
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
|
||||
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
|
||||
|
|
@ -938,7 +938,7 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
|
|||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
|
||||
{
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
|
||||
if(texture_ctrl)
|
||||
{
|
||||
|
|
@ -951,9 +951,9 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
|
|||
|
||||
for(S32 i = 0; i < CORNER_COUNT; ++i)
|
||||
{
|
||||
snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
|
||||
childSetValue(buffer, LLSD(compp->getStartHeight(i)));
|
||||
snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
|
||||
childSetValue(buffer, LLSD(compp->getHeightRange(i)));
|
||||
}
|
||||
|
||||
|
|
@ -968,15 +968,15 @@ BOOL LLPanelRegionTextureInfo::postBuild()
|
|||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
|
||||
{
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
initCtrl(buffer);
|
||||
}
|
||||
|
||||
for(S32 i = 0; i < CORNER_COUNT; ++i)
|
||||
{
|
||||
snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
|
||||
initCtrl(buffer);
|
||||
snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
|
||||
initCtrl(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -1016,13 +1016,13 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
|
|||
|
||||
for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
|
||||
{
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
|
||||
if(texture_ctrl)
|
||||
{
|
||||
LLUUID tmp_id(texture_ctrl->getImageAssetID());
|
||||
tmp_id.toString(id_str);
|
||||
snprintf(buffer, MAX_STRING, "%d %s", i, id_str); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d %s", i, id_str); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
}
|
||||
}
|
||||
|
|
@ -1030,9 +1030,9 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
|
|||
strings.clear();
|
||||
for(S32 i = 0; i < CORNER_COUNT; ++i)
|
||||
{
|
||||
snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer2, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "height_start_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer2, MAX_STRING, "height_range_spin_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); /* Flawfinder: ignore */
|
||||
strings.push_back(strings_t::value_type(buffer));
|
||||
}
|
||||
sendEstateOwnerMessage(msg, "textureheights", invoice, strings);
|
||||
|
|
@ -1046,7 +1046,7 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
|
|||
for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
|
||||
{
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */
|
||||
LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer);
|
||||
if (!texture_ctrl) continue;
|
||||
|
||||
|
|
@ -1151,17 +1151,17 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
|
|||
strings_t strings;
|
||||
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("water_height_spin").asReal()); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("water_height_spin").asReal()); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_raise_spin").asReal()); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("terrain_lower_spin").asReal()); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%f", (F32)childGetValue("sun_hour_slider").asReal() ); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
|
||||
// Grab estate information in case the user decided to set the
|
||||
|
|
@ -1187,11 +1187,11 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
|
|||
estate_sun_hour = panel->getSunHour();
|
||||
}
|
||||
|
||||
snprintf(buffer, MAX_STRING, "%s", (estate_global_time ? "Y" : "N") ); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%s", (estate_global_time ? "Y" : "N") ); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%s", (estate_fixed_sun ? "Y" : "N") ); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%s", (estate_fixed_sun ? "Y" : "N") ); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
snprintf(buffer, MAX_STRING, "%f", estate_sun_hour); /* Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%f", estate_sun_hour); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
|
||||
sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings);
|
||||
|
|
@ -1808,7 +1808,7 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_
|
|||
msg->nextBlock("ParamList");
|
||||
msg->addString("Parameter", buf);
|
||||
|
||||
snprintf(buf, MAX_STRING, "%u", flags); /* Flawfinder: ignore*/
|
||||
snprintf(buf, MAX_STRING, "%u", flags); /* Flawfinder: ignore */
|
||||
msg->nextBlock("ParamList");
|
||||
msg->addString("Parameter", buf);
|
||||
|
||||
|
|
@ -2065,7 +2065,7 @@ void LLPanelEstateInfo::commitEstateInfo()
|
|||
msg->addString("Parameter", getEstateName());
|
||||
|
||||
char buf[MAX_STRING]; /* Flawfinder: ignore*/
|
||||
snprintf(buf, MAX_STRING, "%u", computeEstateFlags()); /* Flawfinder: ignore*/
|
||||
snprintf(buf, MAX_STRING, "%u", computeEstateFlags()); /* Flawfinder: ignore */
|
||||
msg->nextBlock("ParamList");
|
||||
msg->addString("Parameter", buf);
|
||||
|
||||
|
|
@ -2075,7 +2075,7 @@ void LLPanelEstateInfo::commitEstateInfo()
|
|||
sun_hour = 0.f; // 0 = global time
|
||||
}
|
||||
|
||||
snprintf(buf, MAX_STRING, "%d", (S32)(sun_hour*1024.0f)); /* Flawfinder: ignore*/
|
||||
snprintf(buf, MAX_STRING, "%d", (S32)(sun_hour*1024.0f)); /* Flawfinder: ignore */
|
||||
msg->nextBlock("ParamList");
|
||||
msg->addString("Parameter", buf);
|
||||
|
||||
|
|
|
|||
|
|
@ -707,7 +707,7 @@ LLSD LLFloaterReporter::gatherReport()
|
|||
details << childGetValue("details_edit").asString();
|
||||
|
||||
char version_string[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(version_string, /* Flawfinder: ignore */
|
||||
snprintf(version_string, /* Flawfinder: ignore */
|
||||
MAX_STRING,
|
||||
"%d.%d.%d %s %s %s %s",
|
||||
LL_VERSION_MAJOR,
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ void LLFloaterTelehub::onClickRemoveSpawnPoint(void* data)
|
|||
msg->addString("Parameter", "spawnpoint remove");
|
||||
|
||||
char buffer[MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d", spawn_index); /* Flawfinder: ignore */
|
||||
snprintf(buffer, MAX_STRING, "%d", spawn_index); /* Flawfinder: ignore */
|
||||
msg->nextBlock("ParamList");
|
||||
msg->addString("Parameter", buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -818,7 +818,7 @@ LLString LLItemBridge::getLabelSuffix() const
|
|||
if(xfer) sxfer = EMPTY;
|
||||
else sxfer = NO_XFER;
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf( /*Flawfinder: ignore*/
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
buffer,
|
||||
MAX_STRING,
|
||||
"%s%s%s",
|
||||
|
|
|
|||
|
|
@ -1136,7 +1136,7 @@ void LLInventoryModel::cache(
|
|||
char inventory_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
agent_id.toString(agent_id_str);
|
||||
std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, agent_id_str));
|
||||
snprintf( /*Flawfinder: ignore*/
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
inventory_filename,
|
||||
LL_MAX_PATH,
|
||||
CACHE_FORMAT_STRING,
|
||||
|
|
@ -1425,7 +1425,7 @@ bool LLInventoryModel::loadSkeleton(
|
|||
owner_id.toString(owner_id_str);
|
||||
std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str));
|
||||
char inventory_filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
snprintf( /*Flawfinder: ignore*/
|
||||
snprintf( /* Flawfinder: ignore */
|
||||
inventory_filename,
|
||||
LL_MAX_PATH,
|
||||
CACHE_FORMAT_STRING,
|
||||
|
|
|
|||
|
|
@ -435,25 +435,25 @@ void LLManip::renderXYZ(const LLVector3 &vec)
|
|||
LLGLDepthTest gls_depth(GL_FALSE);
|
||||
LLGLEnable tex(GL_TEXTURE_2D);
|
||||
// render drop shadowed text
|
||||
snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /*Flawfinder: ignore*/
|
||||
snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /* Flawfinder: ignore */
|
||||
hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);
|
||||
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /*Flawfinder: ignore*/
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /* Flawfinder: ignore */
|
||||
hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);
|
||||
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /*Flawfinder: ignore*/
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /* Flawfinder: ignore */
|
||||
hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE);
|
||||
|
||||
// render text on top
|
||||
snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /*Flawfinder: ignore*/
|
||||
snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /* Flawfinder: ignore */
|
||||
hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE);
|
||||
|
||||
glColor3f(0.5f, 1.f, 0.5f);
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /*Flawfinder: ignore*/
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /* Flawfinder: ignore */
|
||||
hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE);
|
||||
|
||||
glColor3f(0.5f, 0.5f, 1.f);
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /*Flawfinder: ignore*/
|
||||
snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /* Flawfinder: ignore */
|
||||
hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -502,22 +502,22 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi
|
|||
{
|
||||
if (fractional_portion == 0)
|
||||
{
|
||||
snprintf(val_string, sizeof(val_string), "-%d%s", lltrunc(llabs(val_to_print)), suffix); /*Flawfinder: ignore*/
|
||||
snprintf(val_string, sizeof(val_string), "-%d%s", lltrunc(llabs(val_to_print)), suffix); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(val_string, sizeof(val_string), "-%d", lltrunc(llabs(val_to_print))); /*Flawfinder: ignore*/
|
||||
snprintf(val_string, sizeof(val_string), "-%d", lltrunc(llabs(val_to_print))); /* Flawfinder: ignore */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fractional_portion == 0)
|
||||
{
|
||||
snprintf(val_string, sizeof(val_string), "%d%s", lltrunc(llabs(val_to_print)), suffix); /*Flawfinder: ignore*/
|
||||
snprintf(val_string, sizeof(val_string), "%d%s", lltrunc(llabs(val_to_print)), suffix); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(val_string, sizeof(val_string), "%d", lltrunc(val_to_print)); /*Flawfinder: ignore*/
|
||||
snprintf(val_string, sizeof(val_string), "%d", lltrunc(val_to_print)); /* Flawfinder: ignore */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -540,7 +540,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi
|
|||
LLGLEnable tex(GL_TEXTURE_2D);
|
||||
if (fractional_portion != 0)
|
||||
{
|
||||
snprintf(fraction_string, sizeof(fraction_string), "%c%d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); /*Flawfinder: ignore*/
|
||||
snprintf(fraction_string, sizeof(fraction_string), "%c%d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); /* Flawfinder: ignore */
|
||||
|
||||
gViewerWindow->setupViewport(1, -1);
|
||||
hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection);
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ void LLMuteList::requestFromServer(const LLUUID& agent_id)
|
|||
char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
agent_id.toString(agent_id_string);
|
||||
snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /* Flawfinder: ignore */
|
||||
LLCRC crc;
|
||||
crc.update(filename);
|
||||
|
||||
|
|
@ -469,7 +469,7 @@ void LLMuteList::cache(const LLUUID& agent_id)
|
|||
char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
agent_id.toString(agent_id_string);
|
||||
snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /* Flawfinder: ignore */
|
||||
saveToFile(filename);
|
||||
}
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**)
|
|||
char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
gAgent.getID().toString(agent_id_string);
|
||||
char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /* Flawfinder: ignore */
|
||||
gMuteListp->loadFromFile(filename);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2148,7 +2148,7 @@ void LLPanelAvatar::processAvatarStatisticsReply(LLMessageSystem *msg, void**)
|
|||
item = new LLScrollListItem();
|
||||
item->addColumn( name, font, TEXT_WIDTH );
|
||||
|
||||
snprintf( value_string, sizeof(value_string), "+%d", positive); /*Flawfinder: ignore*/
|
||||
snprintf( value_string, sizeof(value_string), "+%d", positive); /* Flawfinder: ignore */
|
||||
item->addColumn( value_string, font, 50 );
|
||||
|
||||
item->addColumn("", font); // extra column to force striped appearance
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
|
|||
S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)pos_global.mdV[VZ]);
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /* Flawfinder: ignore */
|
||||
location_text.append(buffer);
|
||||
|
||||
U8 flags;
|
||||
|
|
|
|||
|
|
@ -627,7 +627,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
|
|||
|
||||
if ( visible )
|
||||
{
|
||||
snprintf(fee_buff, sizeof(fee_buff), "Join (L$%d)", gdatap->mMembershipFee); /*Flawfinder: ignore*/
|
||||
snprintf(fee_buff, sizeof(fee_buff), "Join (L$%d)", gdatap->mMembershipFee); /* Flawfinder: ignore */
|
||||
mBtnJoinGroup->setLabelSelected(std::string(fee_buff));
|
||||
mBtnJoinGroup->setLabelUnselected(std::string(fee_buff));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max)
|
|||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
buffer[0] = '\0';
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "(%d max)", max); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "(%d max)", max); /* Flawfinder: ignore */
|
||||
if ( mYourContributionMaxTextp )
|
||||
{
|
||||
mYourContributionMaxTextp->setText(buffer);
|
||||
|
|
@ -289,14 +289,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
|
|||
S32 total_contribution;
|
||||
msg->getS32("QueryData", "ActualArea", total_contribution, 0);
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%d sq. meters", total_contribution); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%d sq. meters", total_contribution); /* Flawfinder: ignore */
|
||||
mTotalContributedLandp->setText(buffer);
|
||||
S32 committed;
|
||||
msg->getS32("QueryData", "BillableArea", committed, 0);
|
||||
snprintf(buffer, sizeof(buffer), "%d sq. meters", committed); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%d sq. meters", committed); /* Flawfinder: ignore */
|
||||
mTotalLandInUsep->setText(buffer);
|
||||
S32 available = total_contribution - committed;
|
||||
snprintf(buffer, sizeof(buffer), "%d sq. meters", available); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%d sq. meters", available); /* Flawfinder: ignore */
|
||||
mLandAvailablep->setText(buffer);
|
||||
buffer[0] = '\0';
|
||||
if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
|
||||
|
|
@ -340,18 +340,18 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
|
|||
S32 region_x = llround(global_x) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
|
||||
char location[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /*Flawfinder: ignore*/
|
||||
snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /* Flawfinder: ignore */
|
||||
char area[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
if(billable_area == actual_area)
|
||||
{
|
||||
snprintf(area, MAX_STRING, "%d", billable_area); /*Flawfinder: ignore*/
|
||||
snprintf(area, MAX_STRING, "%d", billable_area); /* Flawfinder: ignore */
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /*Flawfinder: ignore*/
|
||||
snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /* Flawfinder: ignore */
|
||||
}
|
||||
char hidden[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /*Flawfinder: ignore*/
|
||||
snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /* Flawfinder: ignore */
|
||||
|
||||
LLSD row;
|
||||
|
||||
|
|
@ -977,7 +977,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
|
|||
return;
|
||||
}
|
||||
|
||||
snprintf(line, MAX_STRING, "%s\n\n", start_date); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%s\n\n", start_date); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
|
||||
S32 total_amount = 0;
|
||||
|
|
@ -992,7 +992,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
|
|||
|
||||
if (amount != 0)
|
||||
{
|
||||
snprintf(line, MAX_STRING, "%-24s %6d\n", desc, amount ); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%-24s %6d\n", desc, amount ); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
}
|
||||
else
|
||||
|
|
@ -1005,7 +1005,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
|
|||
|
||||
text.append(1, '\n');
|
||||
|
||||
snprintf(line, MAX_STRING, "%-24s %6d\n", "Total", total_amount ); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%-24s %6d\n", "Total", total_amount ); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
|
||||
if ( mImplementationp->mTextEditorp )
|
||||
|
|
@ -1122,7 +1122,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
|
|||
{
|
||||
text.clear();
|
||||
|
||||
snprintf(line, MAX_STRING, "%s\n\n", start_date); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%s\n\n", start_date); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
}
|
||||
|
||||
|
|
@ -1177,7 +1177,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
|
|||
break;
|
||||
}
|
||||
|
||||
snprintf(line, sizeof(line), "%s %6d - %s %s %s\n", time, amount, user, verb, item); /*Flawfinder: ignore*/
|
||||
snprintf(line, sizeof(line), "%s %6d - %s %s %s\n", time, amount, user, verb, item); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
}
|
||||
}
|
||||
|
|
@ -1330,26 +1330,26 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
|
|||
return;
|
||||
}
|
||||
|
||||
snprintf(line, MAX_STRING, "Summary for this week, beginning on %s\n", start_date); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "Summary for this week, beginning on %s\n", start_date); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
|
||||
if (current_interval == 0)
|
||||
{
|
||||
snprintf(line, MAX_STRING, "The next stipend day is %s\n\n", next_stipend_date); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "The next stipend day is %s\n\n", next_stipend_date); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
snprintf(line, MAX_STRING, "%-24sL$%6d\n", "Balance", balance ); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%-24sL$%6d\n", "Balance", balance ); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
|
||||
text.append(1, '\n');
|
||||
}
|
||||
|
||||
snprintf(line, MAX_STRING, " Group Individual Share\n"); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, " Group Individual Share\n"); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members)); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members)); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members)); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members)); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members)); /*Flawfinder: ignore*/
|
||||
snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members)); /* Flawfinder: ignore */
|
||||
text.append(line);
|
||||
|
||||
if ( mImplementationp->mTextEditorp )
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
|
|||
row["columns"][3]["column"] = "date";
|
||||
row["columns"][3]["value"] = buffer;
|
||||
|
||||
snprintf(buffer, 30, "%u", timestamp); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, 30, "%u", timestamp); /* Flawfinder: ignore */
|
||||
row["columns"][4]["column"] = "sort";
|
||||
row["columns"][4]["value"] = buffer;
|
||||
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ void LLPanelPermissions::refresh()
|
|||
else
|
||||
{
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%d Objects, ", obj_count); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%d Objects, ", obj_count); /* Flawfinder: ignore */
|
||||
object_info_string.assign(buffer);
|
||||
}
|
||||
if (1 == prim_count)
|
||||
|
|
@ -375,7 +375,7 @@ void LLPanelPermissions::refresh()
|
|||
else
|
||||
{
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%d Primitives", prim_count); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, MAX_STRING, "%d Primitives", prim_count); /* Flawfinder: ignore */
|
||||
object_info_string.append(buffer);
|
||||
}
|
||||
childSetText("prim info",object_info_string);
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
|
|||
S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround((F32)pos_global.mdV[VZ]);
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /* Flawfinder: ignore */
|
||||
location_text.append(buffer);
|
||||
|
||||
S32 sort_order;
|
||||
|
|
@ -340,7 +340,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
|
|||
self->mLocationEditor->setText(location_text);
|
||||
self->mEnabledCheck->set(enabled);
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%d", sort_order); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%d", sort_order); /* Flawfinder: ignore */
|
||||
self->mSortOrderEditor->setText(buffer);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,16 +174,16 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
|
|||
self->mDescEditor->setText(desc);
|
||||
|
||||
LLString info;
|
||||
snprintf(buffer, sizeof(buffer), "Traffic: %.0f, Area: %d sq. m.", dwell, actual_area); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "Traffic: %.0f, Area: %d sq. m.", dwell, actual_area); /* Flawfinder: ignore */
|
||||
info.append(buffer);
|
||||
if (flags & DFQ_FOR_SALE)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), ", For Sale for L$%d", sale_price); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), ", For Sale for L$%d", sale_price); /* Flawfinder: ignore */
|
||||
info.append(buffer);
|
||||
}
|
||||
if (auction_id != 0)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), ", Auction ID %010d", auction_id); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), ", Auction ID %010d", auction_id); /* Flawfinder: ignore */
|
||||
info.append(buffer);
|
||||
}
|
||||
self->mInfoEditor->setText(info);
|
||||
|
|
@ -199,7 +199,7 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
|
|||
rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE);
|
||||
}
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s %d, %d, %d (%s)", /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%s %d, %d, %d (%s)", /* Flawfinder: ignore */
|
||||
sim_name, region_x, region_y, region_z, rating);
|
||||
self->mLocationEditor->setText(buffer);
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ void LLPanelPlace::callbackAuctionWebPage(S32 option, void* data)
|
|||
if (0 == option)
|
||||
{
|
||||
char url[256]; /*Flawfinder: ignore*/
|
||||
snprintf(url, sizeof(url), "%s%010d", AUCTION_URL, self->mAuctionID); /*Flawfinder: ignore*/
|
||||
snprintf(url, sizeof(url), "%s%010d", AUCTION_URL, self->mAuctionID); /* Flawfinder: ignore */
|
||||
|
||||
llinfos << "Loading auction page " << url << llendl;
|
||||
|
||||
|
|
|
|||
|
|
@ -726,7 +726,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh
|
|||
// if not found, create a new one, add it to the list
|
||||
//-------------------------------------------------------------------------
|
||||
char full_path[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
snprintf(full_path, LL_MAX_PATH, "%s", (gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,name.c_str())).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(full_path, LL_MAX_PATH, "%s", (gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,name.c_str())).c_str()); /* Flawfinder: ignore */
|
||||
|
||||
LLPolyMeshSharedData *mesh_data = new LLPolyMeshSharedData();
|
||||
if (reference_mesh)
|
||||
|
|
@ -804,7 +804,7 @@ void LLPolyMesh::dumpDiagInfo()
|
|||
S32 num_faces = mesh.mNumFaces;
|
||||
U32 num_kb = mesh.getNumKB();
|
||||
|
||||
snprintf(buf, sizeof(buf), "%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name_p->c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name_p->c_str()); /* Flawfinder: ignore */
|
||||
llinfos << buf << llendl;
|
||||
|
||||
total_verts += num_verts;
|
||||
|
|
@ -813,7 +813,7 @@ void LLPolyMesh::dumpDiagInfo()
|
|||
}
|
||||
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
snprintf(buf, sizeof(buf), "%8d %8d %8d TOTAL", total_verts, total_faces, total_kb ); /*Flawfinder: ignore*/
|
||||
snprintf(buf, sizeof(buf), "%8d %8d %8d TOTAL", total_verts, total_faces, total_kb ); /* Flawfinder: ignore */
|
||||
llinfos << buf << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -774,7 +774,7 @@ void LLPreviewGesture::refresh()
|
|||
mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME);
|
||||
mWaitTimeEditor->setVisible(TRUE);
|
||||
char buffer[16]; /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", (double)wait_step->mWaitSeconds); /*Flawfinder: ignore*/
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", (double)wait_step->mWaitSeconds); /* Flawfinder: ignore */
|
||||
mWaitTimeEditor->setText(buffer);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
|
|||
char uuid_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
|
||||
asset_uuid.toString(uuid_string);
|
||||
char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/
|
||||
snprintf(filename, LL_MAX_PATH, "%s.tmp", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /*Flawfinder: ignore*/
|
||||
snprintf(filename, LL_MAX_PATH, "%s.tmp", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string).c_str()); /* Flawfinder: ignore */
|
||||
LLFile::remove(filename);
|
||||
delete info;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ void LLScriptEdCore::draw()
|
|||
S32 column = 0;
|
||||
mEditor->getCurrentLineAndColumn( &line, &column, FALSE ); // don't include wordwrap
|
||||
char cursor_pos[STD_STRING_BUF_SIZE]; /*Flawfinder: ignore*/
|
||||
snprintf( cursor_pos, STD_STRING_BUF_SIZE, "Line %d, Column %d", line, column ); /*Flawfinder: ignore*/
|
||||
snprintf( cursor_pos, STD_STRING_BUF_SIZE, "Line %d, Column %d", line, column ); /* Flawfinder: ignore */
|
||||
childSetText("line_col", cursor_pos);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2059,7 +2059,7 @@ void LLSelectMgr::packGodlikeHead(void* user_data)
|
|||
void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *)
|
||||
{
|
||||
char buf [MAX_STRING]; /* Flawfinder: ignore */
|
||||
snprintf(buf, MAX_STRING, "%u", node->getObject()->getLocalID()); /* Flawfinder: ignore */
|
||||
snprintf(buf, MAX_STRING, "%u", node->getObject()->getLocalID()); /* Flawfinder: ignore */
|
||||
gMessageSystem->nextBlock("ParamList");
|
||||
gMessageSystem->addString("Parameter", buf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -747,7 +747,7 @@ BOOL idle_startup()
|
|||
if (gUserServerChoice == USERSERVER_OTHER)
|
||||
{
|
||||
gUserServer.setHostByName( server_label.c_str() );
|
||||
snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */
|
||||
snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5383,7 +5383,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
|
|||
LLString short_name = filename.substr(offset);
|
||||
|
||||
// No extension
|
||||
snprintf(error_message, /* Flawfinder: ignore */
|
||||
snprintf(error_message, /* Flawfinder: ignore */
|
||||
MAX_STRING,
|
||||
"No file extension for the file: '%s'\nPlease make sure the file has a correct file extension",
|
||||
short_name.c_str());
|
||||
|
|
@ -5532,7 +5532,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
|
|||
else
|
||||
{
|
||||
fclose(in);
|
||||
snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */
|
||||
snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */
|
||||
args["[FILE]"] = src_filename;
|
||||
upload_error(error_message, "UnknownResourceFileVersion", filename, args);
|
||||
return;
|
||||
|
|
@ -5568,7 +5568,7 @@ void upload_new_resource(const LLString& src_filename, std::string name,
|
|||
else
|
||||
{
|
||||
fclose(in);
|
||||
snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */
|
||||
snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */
|
||||
args["[FILE]"] = filename;
|
||||
upload_error(error_message, "UnableToCreateOutputFile", filename, args);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,22 @@ class LLSD;
|
|||
|
||||
namespace tut
|
||||
{
|
||||
inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len)
|
||||
{
|
||||
if((expected_len != actual_len) ||
|
||||
(memcmp(actual, expected, actual_len) != 0))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << (msg?msg:"") << (msg?": ":"") << "not equal";
|
||||
throw tut::failure(ss.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
inline void ensure_memory_matches(const void* actual, U32 actual_len, const void* expected,U32 expected_len)
|
||||
{
|
||||
ensure_memory_matches(NULL, actual, actual_len, expected, expected_len);
|
||||
}
|
||||
|
||||
template <class T,class Q>
|
||||
void ensure_not_equals(const char* msg,const Q& actual,const T& expected)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ public:
|
|||
mVerboseMode(verbose_mode),
|
||||
mTotalTests(0),
|
||||
mPassedTests(0),
|
||||
mFailedTests(0)
|
||||
mFailedTests(0),
|
||||
mSkippedTests(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -79,6 +80,10 @@ public:
|
|||
++mFailedTests;
|
||||
out << "abnormal termination";
|
||||
break;
|
||||
case tut::test_result::skip:
|
||||
++mSkippedTests;
|
||||
out << "skipped";
|
||||
break;
|
||||
default:
|
||||
++mFailedTests;
|
||||
out << "unknown";
|
||||
|
|
@ -94,6 +99,12 @@ public:
|
|||
std::cout << std::endl;
|
||||
std::cout << "Total Tests: " << mTotalTests << std::endl;
|
||||
std::cout << "Passed Tests : " << mPassedTests << std::endl;
|
||||
|
||||
if (mSkippedTests > 0)
|
||||
{
|
||||
std::cout << "Skipped Tests : " << mSkippedTests << std::endl;
|
||||
}
|
||||
|
||||
if(mFailedTests > 0)
|
||||
{
|
||||
std::cout << "*********************************" << std::endl;
|
||||
|
|
@ -109,6 +120,7 @@ protected:
|
|||
S32 mTotalTests;
|
||||
S32 mPassedTests;
|
||||
S32 mFailedTests;
|
||||
S32 mSkippedTests;
|
||||
};
|
||||
|
||||
static const apr_getopt_option_t TEST_CL_OPTIONS[] =
|
||||
|
|
@ -117,6 +129,7 @@ static const apr_getopt_option_t TEST_CL_OPTIONS[] =
|
|||
{"list", 'l', 0, "List available test groups."},
|
||||
{"verbose", 'v', 0, "Verbose output."},
|
||||
{"group", 'g', 1, "Run test group specified by option argument."},
|
||||
{"skip", 's', 1, "Skip test number specified by option argument. Only works when a specific group is being tested"},
|
||||
{"wait", 'w', 0, "Wait for input before exit."},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
|
@ -146,6 +159,8 @@ void stream_usage(std::ostream& s, const char* app)
|
|||
s << "\tList all available test groups." << std::endl;
|
||||
s << " " << app << " --group=uuid" << std::endl;
|
||||
s << "\tRun the test group 'uuid'." << std::endl;
|
||||
s << " " << app << " --skip=2" << std::endl;
|
||||
s << "\tSkip test case 2." << std::endl;
|
||||
}
|
||||
|
||||
void stream_groups(std::ostream& s, const char* app)
|
||||
|
|
@ -193,6 +208,7 @@ int main(int argc, char **argv)
|
|||
// values used for controlling application
|
||||
bool verbose_mode = false;
|
||||
bool wait_at_exit = false;
|
||||
int skip_test_id = 0;
|
||||
std::string test_group;
|
||||
|
||||
// values use for options parsing
|
||||
|
|
@ -215,6 +231,9 @@ int main(int argc, char **argv)
|
|||
case 'g':
|
||||
test_group.assign(opt_arg);
|
||||
break;
|
||||
case 's':
|
||||
skip_test_id = atoi(opt_arg);
|
||||
break;
|
||||
case 'h':
|
||||
stream_usage(std::cout, argv[0]);
|
||||
return 0;
|
||||
|
|
@ -245,7 +264,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
tut::runner.get().run_tests(test_group);
|
||||
tut::runner.get().run_tests(test_group, skip_test_id);
|
||||
}
|
||||
|
||||
if (wait_at_exit)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <wininet.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include "llpreprocessor.h"
|
||||
#include "llfile.h"
|
||||
|
||||
|
|
@ -488,11 +489,13 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
|
|||
char params[2048]; /* Flawfinder: ignore */
|
||||
if (gIsSilent && gProgramName)
|
||||
{
|
||||
snprintf(params, sizeof(params), "/S /P=\"%s\"", gProgramName); /* Flawfinder: ignore */
|
||||
_snprintf(params, sizeof(params), "/S /P=\"%s\"", gProgramName); /* Flawfinder: ignore */
|
||||
params[2047] = '\0';
|
||||
}
|
||||
else if (gProgramName)
|
||||
{
|
||||
snprintf(params, sizeof(params), "/P=\"%s\"", gProgramName); /* Flawfinder: ignore */
|
||||
_snprintf(params, sizeof(params), "/P=\"%s\"", gProgramName); /* Flawfinder: ignore */
|
||||
params[2047] = '\0';
|
||||
}
|
||||
else if (gIsSilent)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue