Try to appease MSVC

llvm-svn: 118487
This commit is contained in:
Douglas Gregor 2010-11-09 04:38:09 +00:00
parent b4f65501fc
commit 416463f7f3
2 changed files with 9 additions and 0 deletions

View File

@ -105,7 +105,11 @@ std::string DocumentXML::escapeString(const char* pStr,
if (isprint(C))
value += C;
else {
#ifdef LLVM_ON_WIN32
sprintf(buffer, "\\%03o", C);
#else
snprintf(buffer, sizeof(buffer), "\\%03o", C);
#endif
value += buffer;
}
break;

View File

@ -498,8 +498,13 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc,
};
char TmpBuffer[32];
#ifdef LLVM_ON_WIN32
sprintf(TmpBuffer, "\"%s %2d %4d\"", Months[TM->tm_mon], TM->tm_mday,
TM->tm_year+1900);
#else
snprintf(TmpBuffer, sizeof(TmpBuffer), "\"%s %2d %4d\"", Months[TM->tm_mon], TM->tm_mday,
TM->tm_year+1900);
#endif
Token TmpTok;
TmpTok.startToken();