summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Regex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Regex.cpp')
-rw-r--r--llvm/lib/Support/Regex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Regex.cpp b/llvm/lib/Support/Regex.cpp
index dec967e33f5..54136418407 100644
--- a/llvm/lib/Support/Regex.cpp
+++ b/llvm/lib/Support/Regex.cpp
@@ -43,7 +43,7 @@ bool Regex::isValid(std::string &Error) {
size_t len = llvm_regerror(error, preg, NULL, 0);
- Error.resize(len);
+ Error.resize(len - 1);
llvm_regerror(error, preg, &Error[0], len);
return false;
}
OpenPOWER on IntegriCloud