lib/Lex/PPMacroExpansion.cpp: Fixup to appease MSVC.

Confirmed on MSVS10.

llvm-svn: 118496
This commit is contained in:
NAKAMURA Takumi 2010-11-09 06:27:32 +00:00
parent 229bebdeb5
commit c0d7d99cc1
1 changed files with 4 additions and 0 deletions

View File

@ -512,7 +512,11 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc,
PP.CreateString(TmpBuffer, strlen(TmpBuffer), TmpTok);
DATELoc = TmpTok.getLocation();
#ifdef LLVM_ON_WIN32
sprintf(TmpBuffer, "\"%02d:%02d:%02d\"", TM->tm_hour, TM->tm_min, TM->tm_sec);
#else
snprintf(TmpBuffer, sizeof(TmpBuffer), "\"%02d:%02d:%02d\"", TM->tm_hour, TM->tm_min, TM->tm_sec);
#endif
PP.CreateString(TmpBuffer, strlen(TmpBuffer), TmpTok);
TIMELoc = TmpTok.getLocation();
}