aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb_regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdb_regex.c')
-rw-r--r--gdb/gdb_regex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/gdb_regex.c b/gdb/gdb_regex.c
index 2e376e3..55c3980 100644
--- a/gdb/gdb_regex.c
+++ b/gdb/gdb_regex.c
@@ -17,6 +17,7 @@
#include "defs.h"
#include "gdb_regex.h"
+#include "common/def-vector.h"
compiled_regex::compiled_regex (const char *regex, int cflags,
const char *message)
@@ -28,10 +29,10 @@ compiled_regex::compiled_regex (const char *regex, int cflags,
if (code != 0)
{
size_t length = regerror (code, &m_pattern, NULL, 0);
- std::unique_ptr<char[]> err (new char[length]);
+ gdb::def_vector<char> err (length);
- regerror (code, &m_pattern, err.get (), length);
- error (("%s: %s"), message, err.get ());
+ regerror (code, &m_pattern, err.data (), length);
+ error (("%s: %s"), message, err.data ());
}
}