Replace snprintf with raw_string_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Francois Pichet 2011-10-04 21:08:56 +00:00
parent 20f8eb2fc1
commit 11ad7e5d58

View File

@ -24,10 +24,6 @@
#include <cstdlib>
#include <cstring>
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
namespace llvm {
typedef std::map<std::string, std::string> TGPPEnvironment;
@ -170,9 +166,10 @@ public:
if (Kind == tgpprange_list)
return Vals.at(i);
else {
char buf[32];
snprintf(buf, sizeof(buf), "%ld", From + (long int)i);
return std::string(buf);
std::string Result;
raw_string_ostream Tmp(Result);
Tmp << (From + (long int)i);
return Tmp.str();
}
}