From f25ddd991a5601d0101602c4c263a58c7af4b8a2 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Tue, 16 Feb 2010 09:30:23 +0000 Subject: Update LLVM to r96341. --- lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp') diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index c02d84f..7b061d3 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -368,7 +368,7 @@ GenericValue lle_X_sprintf(const FunctionType *FT, switch (Last) { case '%': - strcpy(Buffer, "%"); break; + memcpy(Buffer, "%", 2); break; case 'c': sprintf(Buffer, FmtBuf, uint32_t(Args[ArgNo++].IntVal.getZExtValue())); break; @@ -400,8 +400,9 @@ GenericValue lle_X_sprintf(const FunctionType *FT, errs() << ""; ArgNo++; break; } - strcpy(OutputBuffer, Buffer); - OutputBuffer += strlen(Buffer); + size_t Len = strlen(Buffer); + memcpy(OutputBuffer, Buffer, Len + 1); + OutputBuffer += Len; } break; } -- cgit v1.1