Skip to content

Commit a0f7be0

Browse files
aus-inteligcbot
authored andcommitted
Replace sprintf with ostringstream
1 parent 4bb0559 commit a0f7be0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

IGC/VectorCompiler/igcdeps/src/TranslationInterface.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4646
#include <common/igc_regkeys.hpp>
4747
#include <iStdLib/utility.h>
4848
#include <inc/common/secure_mem.h>
49-
#include <inc/common/secure_string.h>
5049

5150
#include <algorithm>
5251
#include <memory>
52+
#include <sstream>
5353
#include <system_error>
5454

5555
#include <cstring>
@@ -115,11 +115,10 @@ static VcPayloadInfo tryExtractPayload(const char *Input, size_t InputSize) {
115115
}
116116

117117
static std::unique_ptr<llvm::MemoryBuffer> getGenericModuleBuffer() {
118-
// FIXME: ostringstream.
119-
char Resource[5] = {'-'};
120-
_snprintf_s(Resource, sizeof(Resource), sizeof(Resource), "#%d", OCL_BC);
118+
std::ostringstream SS;
119+
SS << '#' << static_cast<int>(OCL_BC);
121120
return std::unique_ptr<llvm::MemoryBuffer>{
122-
llvm::LoadBufferFromResource(Resource, "BC")};
121+
llvm::LoadBufferFromResource(SS.str().c_str(), "BC")};
123122
}
124123

125124
static void adjustPlatform(const IGC::CPlatform &IGCPlatform,

0 commit comments

Comments
 (0)