diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 0435d89fb16a007e9e65e1c6a790dc73d7c9f5fa..59332bf9e61cb7ae97fbb440b156b53dc03ac823 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -2062,7 +2062,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); char source_volume[16]; /* Flawfinder: ignore */ - absl::SNPrintF(source_volume, sizeof(source_volume), "%s", /* Flawfinder: ignore */ + snprintf(source_volume, sizeof(source_volume), "%s", /* Flawfinder: ignore */ mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str()); success &= dp.packBinaryDataFixed((U8*)source_volume, 16, "source_volume"); @@ -2070,11 +2070,11 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const char target_volume[16]; /* Flawfinder: ignore */ if (shared_constraintp->mConstraintTargetType == CONSTRAINT_TARGET_TYPE_GROUND) { - absl::SNPrintF(target_volume,sizeof(target_volume), "%s", "GROUND"); /* Flawfinder: ignore */ + snprintf(target_volume,sizeof(target_volume), "%s", "GROUND"); /* Flawfinder: ignore */ } else { - absl::SNPrintF(target_volume, sizeof(target_volume),"%s", /* Flawfinder: ignore */ + snprintf(target_volume, sizeof(target_volume),"%s", /* Flawfinder: ignore */ mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); } success &= dp.packBinaryDataFixed((U8*)target_volume, 16, "target_volume"); @@ -2387,6 +2387,8 @@ void LLKeyframeDataCache::dumpDiagInfo() // keep track of totals U32 total_size = 0; + char buf[1024]; /* Flawfinder: ignore */ + LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; LL_INFOS() << " Global Motion Table (DEBUG only)" << LL_ENDL; LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; @@ -2408,7 +2410,8 @@ void LLKeyframeDataCache::dumpDiagInfo() LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; LL_INFOS() << "Motions\tTotal Size" << LL_ENDL; - LL_INFOS() << absl::StreamFormat("%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size) << LL_ENDL; + snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */ + LL_INFOS() << buf << LL_ENDL; LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; } diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp index 644765cf1dbe57e698fe44bd9c2d589aa3ce4be1..f5afd3cee6efb7609d8c99aced9b7cc551bed8f3 100644 --- a/indra/llcharacter/llmultigesture.cpp +++ b/indra/llcharacter/llmultigesture.cpp @@ -466,24 +466,24 @@ BOOL LLGestureStepWait::deserialize(LLDataPacker& dp) std::vector<std::string> LLGestureStepWait::getLabel() const { std::vector<std::string> strings; - strings.emplace_back( "Wait" ); + strings.push_back( "Wait" ); // std::string label("--- Wait: "); if (mFlags & WAIT_FLAG_TIME) { - std::string str = absl::StrFormat("%.1f seconds", mWaitSeconds); - - strings.push_back(std::move(str)); + char buffer[64]; /* Flawfinder: ignore */ + snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */ + strings.push_back(buffer); // label += buffer; } else if (mFlags & WAIT_FLAG_ALL_ANIM) { - strings.emplace_back("until animations are done"); + strings.push_back("until animations are done"); // label += "until animations are done"; } else { - strings.emplace_back(""); + strings.push_back(""); } return strings; diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 3a83ddc894921180518644f700e7aa8bbd4cf349..d6fd4669c757490cb6e1efb8ec987f00faa62bb0 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -670,24 +670,29 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // There's a CURLOPT for this now... if ((mReqOffset || mReqLength) && HOR_GET == mReqMethod) { - constexpr absl::string_view fmt1 = "Range: bytes=%lu-%lu"; - constexpr absl::string_view fmt2 = "Range: bytes=%lu-"; + static const char * const fmt1("Range: bytes=%lu-%lu"); + static const char * const fmt2("Range: bytes=%lu-"); char range_line[64]; +#if LL_WINDOWS + _snprintf_s(range_line, sizeof(range_line), sizeof(range_line) - 1, + (mReqLength ? fmt1 : fmt2), + (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1)); +#else if ( mReqLength ) { - absl::SNPrintF(range_line, sizeof(range_line), + snprintf(range_line, sizeof(range_line), fmt1, (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1)); } else { - absl::SNPrintF(range_line, sizeof(range_line), + snprintf(range_line, sizeof(range_line), fmt2, (unsigned long) mReqOffset); } - +#endif // LL_WINDOWS range_line[sizeof(range_line) - 1] = '\0'; mCurlHeaders = curl_slist_append(mCurlHeaders, range_line); } diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp index 77bd3e1c77e71f05f40cdeb7ce65c219bd43816b..e8b806059d1ca510976dd2a5c80baad3eef50912 100644 --- a/indra/llcorehttp/examples/http_texture_load.cpp +++ b/indra/llcorehttp/examples/http_texture_load.cpp @@ -455,9 +455,11 @@ bool WorkingSet::reload(LLCore::HttpRequest * hr, LLCore::HttpOptions::ptr_t & o for (int i(0); i < to_do; ++i) { char buffer[1024]; - - absl::SNPrintF(buffer, sizeof(buffer), mUrl.c_str(), mAssets[mAt].mUuid.c_str()); - +#if defined(WIN32) + _snprintf_s(buffer, sizeof(buffer), sizeof(buffer) - 1, mUrl.c_str(), mAssets[mAt].mUuid.c_str()); +#else + snprintf(buffer, sizeof(buffer), mUrl.c_str(), mAssets[mAt].mUuid.c_str()); +#endif int offset(mNoRange ? 0 : (mRandomRange ? ((unsigned long) rand()) % 1000000UL : mAssets[mAt].mOffset)); diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index 20a060e96f26b2f8c14c49901df2be846e1a0a4c..11f6b71f2f2195641bfe87a15e4949111371e327 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -2762,7 +2762,7 @@ void HttpRequestTestObjectType::test<22>() for (int i(0); i < test_count; ++i) { char buffer[128]; - absl::SNPrintF(buffer, sizeof(buffer), "/bug2295/%d/", i); + snprintf(buffer, sizeof(buffer), "/bug2295/%d/", i); HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, 0U, url_base + buffer, @@ -2794,7 +2794,7 @@ void HttpRequestTestObjectType::test<22>() for (int i(0); i < test2_count; ++i) { char buffer[128]; - absl::SNPrintF(buffer, sizeof(buffer), "/bug2295/00000012/%d/", i); + snprintf(buffer, sizeof(buffer), "/bug2295/00000012/%d/", i); HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, 0U, url_base + buffer, @@ -2826,7 +2826,7 @@ void HttpRequestTestObjectType::test<22>() for (int i(0); i < test3_count; ++i) { char buffer[128]; - absl::SNPrintF(buffer, sizeof(buffer), "/bug2295/inv_cont_range/%d/", i); + snprintf(buffer, sizeof(buffer), "/bug2295/inv_cont_range/%d/", i); HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, 0U, url_base + buffer, diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 6edb473fac66bae1dc3e67421cebb7da5ebc3ee6..51043739266b50d437af33b6b88140e4d213c8cc 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -622,7 +622,7 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog() S32 cur_line = 0; for (i = 0; i < mBufferSize; i++) { - absl::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) { @@ -647,7 +647,7 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\n", value.c_str()); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\n", value.c_str()); /* Flawfinder: ignore */ } else { @@ -691,7 +691,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::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, @@ -711,7 +711,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch BOOL bBufferFull = FALSE; for (i = 0; i < size && !bBufferFull; i++) { - numCopied = absl::SNPrintF(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */ if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); @@ -723,7 +723,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (!bBufferFull) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */ if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); @@ -785,7 +785,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con BOOL bBufferFull = FALSE; for (i = 0; i < size && !bBufferFull; i++) { - numCopied = absl::SNPrintF(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */ if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); @@ -797,7 +797,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con } if (!bBufferFull) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(), "\n"); /* Flawfinder: ignore */ if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); @@ -851,12 +851,12 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name) int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::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 = absl::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 @@ -899,11 +899,11 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name) int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */ } else { - numCopied = absl::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 @@ -947,11 +947,11 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name) int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%u\n", value); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%u\n", value); /* Flawfinder: ignore */ } else { - numCopied = absl::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 @@ -991,11 +991,11 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name) int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%d\n", value); /* Flawfinder: ignore */ } else { - numCopied = absl::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 @@ -1035,11 +1035,11 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%f\n", value); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f\n", value); /* Flawfinder: ignore */ } else { - numCopied = absl::SNPrintF(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%f\n", value); /* Flawfinder: ignore */ + numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%f\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 @@ -1079,11 +1079,11 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ } else { - numCopied = absl::SNPrintF(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ + numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f %f\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 @@ -1122,11 +1122,11 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::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 = absl::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 */ + 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 @@ -1172,11 +1172,11 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ } else { - numCopied = absl::SNPrintF(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ + numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f\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 @@ -1216,11 +1216,11 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ } else { - numCopied = absl::SNPrintF(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ + numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f\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 @@ -1259,11 +1259,11 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ } else { - numCopied = absl::SNPrintF(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ + numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f %f\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 @@ -1306,7 +1306,7 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name) { std::string tmp_str; value.toString(tmp_str); - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\n", tmp_str.c_str()); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\n", tmp_str.c_str()); /* Flawfinder: ignore */ } else { @@ -1357,7 +1357,7 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) int numCopied = 0; if (mWriteEnabled) { - numCopied = absl::SNPrintF(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\t", name); /* Flawfinder: ignore */ + numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%s\t", name); /* Flawfinder: ignore */ } else { @@ -1430,7 +1430,7 @@ std::string convertF32ToString(F32 val) { std::string str; char buf[20]; - absl::SNPrintF(buf, 20, "%f", val); + snprintf(buf, 20, "%f", val); str = buf; return str; } @@ -1485,13 +1485,13 @@ BOOL LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char else if (mOutputStream) { char buffer[32]; /* Flawfinder: ignore */ - absl::SNPrintF(buffer,sizeof(buffer), "%010d ", size); /* Flawfinder: ignore */ + snprintf(buffer,sizeof(buffer), "%010d ", size); /* Flawfinder: ignore */ *mOutputStream << buffer; S32 i; for (i = 0; i < size; i++) { - absl::SNPrintF(buffer, sizeof(buffer), "%02x ", value[i]); /* Flawfinder: ignore */ + snprintf(buffer, sizeof(buffer), "%02x ", value[i]); /* Flawfinder: ignore */ *mOutputStream << buffer; } *mOutputStream << "\n"; @@ -1545,7 +1545,7 @@ BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const S32 i; for (i = 0; i < size; i++) { - absl::SNPrintF(buffer, sizeof(buffer), "%02x ", value[i]); /* Flawfinder: ignore */ + snprintf(buffer, sizeof(buffer), "%02x ", value[i]); /* Flawfinder: ignore */ *mOutputStream << buffer; } *mOutputStream << "\n"; diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index 58fcf88b101e461f2357f8dac8a149865e6b569b..dd5a655d7ebffa43137f34351539b944888dbfbb 100644 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -126,7 +126,7 @@ void pack_instant_message_block( if(!message.empty()) { char buffer[MTUBYTES]; - int num_written = absl::SNPrintF(buffer, MTUBYTES, "%s", message); /* Flawfinder: ignore */ + int num_written = snprintf(buffer, MTUBYTES, "%s", message.c_str()); /* 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 diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 89ffcf0b5cdcf29720745aa0f853d8aadddd7f7f..06fe866dbfdae26897f7444e9f8c829c6b991f43 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -3110,7 +3110,7 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs( d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ - absl::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 */ @@ -3372,7 +3372,7 @@ void LLMessageSystem::dumpPacketToLog() for (i = 0; i < mTrueReceiveSize; i++) { S32 offset = cur_line_pos * 3; - absl::SNPrintF(line_buffer + offset, sizeof(line_buffer) - offset, + snprintf(line_buffer + offset, sizeof(line_buffer) - offset, "%02x ", mTrueReceiveBuffer[i]); /* Flawfinder: ignore */ cur_line_pos++; if (cur_line_pos >= 16) diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index e5eecbe709e591d4b7a820b629be3b319556cf7c..de3e482613197a325df08a552a956dec3f80598a 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1258,7 +1258,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do { //Build a joint for the resolver to work with char str[64]={}; - absl::SNPrintF(str, sizeof(str), "./%s", (*jointIt).first.c_str() ); + snprintf(str, sizeof(str), "./%s", (*jointIt).first.c_str() ); //LL_WARNS()<<"Joint "<< str <<LL_ENDL; //Setup the resolver diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index b10b5b4c995bd670f713c9675298ab5541fdbe2b..284dfc15f46e4961b862c1703c79c60cfa7120ab 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -626,10 +626,10 @@ std::string LLTextureEntry::touchMediaVersionString(const std::string &in_versio // where "nnnnn" is version number // *NOTE: not the most efficient code in the world... U32 current_version = getVersionFromMediaVersionString(in_version) + 1; - constexpr size_t MAX_VERSION_LEN = 10; // 2^32 fits in 10 decimal digits + const size_t MAX_VERSION_LEN = 10; // 2^32 fits in 10 decimal digits char buf[MAX_VERSION_LEN+1]; - absl::SNPrintF(buf, MAX_VERSION_LEN+1, "%0*u", MAX_VERSION_LEN, current_version); // added int cast to fix warning/breakage on mac. - return absl::StrCat(MEDIA_VERSION_STRING_PREFIX, buf, "/", agent_id.asString()); + snprintf(buf, (int)MAX_VERSION_LEN+1, "%0*u", (int)MAX_VERSION_LEN, current_version); // added int cast to fix warning/breakage on mac. + return MEDIA_VERSION_STRING_PREFIX + buf + "/" + agent_id.asString(); } //static diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp index dc455a583d19e56ff47113bd88e1e4783da514d9..e316ea7c824791e0957ca4562a31307d62138b21 100644 --- a/indra/llrender/llgldbg.cpp +++ b/indra/llrender/llgldbg.cpp @@ -79,7 +79,7 @@ const char *boolstr(int b) const char *fv4(F32 *f) { static char str[128]; - absl::SNPrintF(str, sizeof(str), "%8.3f %8.3f %8.3f %8.3f", f[0], f[1], f[2], f[3]); + snprintf(str, sizeof(str), "%8.3f %8.3f %8.3f %8.3f", f[0], f[1], f[2], f[3]); return str; } @@ -89,7 +89,7 @@ const char *fv4(F32 *f) const char *fv3(F32 *f) { static char str[128]; /* Flawfinder: ignore */ - absl::SNPrintF(str, sizeof(str), "%8.3f, %8.3f, %8.3f", f[0], f[1], f[2]); /* Flawfinder: ignore */ + snprintf(str, sizeof(str), "%8.3f, %8.3f, %8.3f", f[0], f[1], f[2]); /* Flawfinder: ignore */ return str; } @@ -99,7 +99,7 @@ const char *fv3(F32 *f) const char *fv1(F32 *f) { static char str[128]; /* Flawfinder: ignore */ - absl::SNPrintF(str, sizeof(str), "%8.3f", f[0]); /* Flawfinder: ignore */ + snprintf(str, sizeof(str), "%8.3f", f[0]); /* Flawfinder: ignore */ return str; } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index b4184e6e36ba89913f730a12f557c27785b15b02..14e05fd44098ad8abc7b59e77444ab81212d9a36 100644 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -92,7 +92,7 @@ const char *makeNewAutoName() { static char name[64]; static S32 auto_namer_number = 0; - absl::SNPrintF(name,64,"auto_name_%d",auto_namer_number); + snprintf(name,64,"auto_name_%d",auto_namer_number); auto_namer_number++; return name; }