summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-01-14 04:52:10 -0700
committerKarl Williamson <khw@cpan.org>2021-01-20 06:51:49 -0700
commit80318d2b040211edc9d94d10bc5d79497be66324 (patch)
treeb1e7508a939849cf3bc393b24e0156fe03188cb0
parente8ba086966639eb1fc2185bfc1b5026ad30cfdd7 (diff)
downloadperl-80318d2b040211edc9d94d10bc5d79497be66324.tar.gz
regcomp.c: Move initialization into declaration
This is considered better practice.
-rw-r--r--regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 6509129737..b7208133da 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13725,9 +13725,9 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
else {
STRLEN length;
char name = *RExC_parse;
- char * endbrace = NULL;
+ char * endbrace = (char *) memchr(RExC_parse, '}',
+ RExC_end - RExC_parse);
RExC_parse += 2;
- endbrace = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);
if (! endbrace) {
vFAIL2("Missing right brace on \\%c{}", name);