MSVC build fix following r211749

Avoid strndup()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alp Toker
2014-06-26 00:25:41 +00:00
parent f93fe90504
commit 45f166017c
3 changed files with 13 additions and 10 deletions
+2 -1
View File
@@ -110,7 +110,8 @@ LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
if (OutMessage) {
string_ostream os;
Diag.print(nullptr, os, false);
*OutMessage = strndup(os.str().data(), os.str().size());
os << '\0';
*OutMessage = strdup(os.str().data());
}
return 1;
}