Improve LLVM compatibility a little bit

This commit is contained in:
Justine Tunney 2021-05-16 20:34:46 -07:00
parent 3057315a1b
commit 1a3d22b2fd
7 changed files with 14 additions and 12 deletions

View file

@ -35,7 +35,7 @@ FILE *tmpfile(void) {
char *tmp, *sep, tpl[PATH_MAX];
tmp = firstnonnull(getenv("TMPDIR"), kTmpPath);
sep = !isempty(tmp) && !endswith(tmp, "/") ? "/" : "";
if (snprintf(tpl, PATH_MAX, "%s%stmp.XXXXXX", tmp, sep) < PATH_MAX) {
if ((snprintf)(tpl, PATH_MAX, "%s%stmp.XXXXXX", tmp, sep) < PATH_MAX) {
if ((fd = mkostemps(tpl, 0, 0)) != -1) {
return fdopen(fd, "w+");
}