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

@ -47,7 +47,7 @@ static const char kRegexErrors[] =
* @return number of bytes needed to hold entire string
*/
size_t regerror(int e, const regex_t *preg, char *buf, size_t size) {
return 1 + snprintf(buf, size, "%s",
firstnonnull(IndexDoubleNulString(kRegexErrors, e),
"Unknown error"));
return 1 + (snprintf)(buf, size, "%s",
firstnonnull(IndexDoubleNulString(kRegexErrors, e),
"Unknown error"));
}