[Support] Treat truncation of fullpath as error
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Wed, 13 Mar 2019 10:37:56 +0000 (10:37 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Wed, 13 Mar 2019 10:37:56 +0000 (10:37 +0000)
commite59746f8f823b833e902d79468d9779431744ddd
tree36259097cd66aab10474dbdd9de19e5b60f5752b
parent18f95e6a6f1abf486f84ced59edebdc2227a9de2
[Support] Treat truncation of fullpath as error

If the concatenation of arguments dir and bin has at least PATH_MAX
characters the call to snprintf will truncate. The result will usually
not exist, but if it does it's actually incorrect to return that the
path exists.
(Motivated by GCC compiler warning about format truncation.)

Differential Revision: https://reviews.llvm.org/D58835

llvm-svn: 356036
llvm/lib/Support/Unix/Path.inc