From bd871c5372ec3c249629c396c8c40bf68033bab2 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 23 Jan 2023 20:03:29 +0100 Subject: [PATCH] Fix last PCRE2_UCHAR32 See #9502 --- src/re.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/re.cpp b/src/re.cpp index 120473325..54ee295bc 100644 --- a/src/re.cpp +++ b/src/re.cpp @@ -271,7 +271,7 @@ maybe_t regex_t::substitute(const wcstring &subject, const wcstring &r wcstring res(bufflen, L'\0'); rc = pcre2_substitute(get_code(code_), to_sptr(subject), subject.size(), start_idx, options, nullptr /* match_data */, nullptr /* context */, to_sptr(replacement), - replacement.size(), reinterpret_cast(&res[0]), + replacement.size(), reinterpret_cast(&res[0]), &bufflen); if (out_repl_count) { *out_repl_count = std::max(rc, 0);