From 3efa2ad93b7f44079d77974543dd31f9b842f038 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 18 May 2019 20:54:08 +0200 Subject: [PATCH] Replace wcslen with math --- src/expand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expand.cpp b/src/expand.cpp index a8b3daefc..1cc38b00d 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -542,7 +542,7 @@ static expand_result_t expand_braces(const wcstring &instr, expand_flags_t flags } length_preceding_braces = (brace_begin - in); - length_following_braces = std::wcslen(brace_end) - 1; + length_following_braces = instr.size() - (brace_end - in) - 1; tot_len = length_preceding_braces + length_following_braces; item_begin = brace_begin + 1; for (const wchar_t *pos = (brace_begin + 1); true; pos++) {