Use strcpy instead of sprintf here. This avoids a GCC 4.3 format-string
authorDan Gohman <gohman@apple.com>
Tue, 5 Aug 2008 23:36:35 +0000 (23:36 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 5 Aug 2008 23:36:35 +0000 (23:36 +0000)
warning. There wasn't actually a problem here, because the contents of
the string are known.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54385 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

index b85f270f9e0a3663d89e5479dabd8e0596df76d8..684d7db874c0c0e8364825642143e8972fa2b106 100644 (file)
@@ -343,7 +343,7 @@ GenericValue lle_X_sprintf(FunctionType *FT, const vector<GenericValue> &Args) {
 
       switch (Last) {
       case '%':
-        sprintf(Buffer, FmtBuf); break;
+        strcpy(Buffer, "%"); break;
       case 'c':
         sprintf(Buffer, FmtBuf, uint32_t(Args[ArgNo++].IntVal.getZExtValue()));
         break;