Be more conservative about gethostname()'s truncating behaviour
authorBen Langmuir <blangmuir@apple.com>
Mon, 9 Feb 2015 21:55:44 +0000 (21:55 +0000)
committerBen Langmuir <blangmuir@apple.com>
Mon, 9 Feb 2015 21:55:44 +0000 (21:55 +0000)
commit541c202be860af8564766bcd787f105002e3dde4
tree991fc5630468d26016aada93c20198e29ddada6d
parent5fc82fd6b5af5ae9d2f43ee847213ba2fbeda45f
Be more conservative about gethostname()'s truncating behaviour

Don't assume it will provide an error or null-terminate the string on
truncation, since POSIX doesn't guarantee either behaviour (although
Linux and Darwin at least will do the 'right thing').

llvm-svn: 228613
clang/lib/Frontend/CompilerInvocation.cpp