integrate cfgperl contents into mainline
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 9543710..89b3e53 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -2606,7 +2606,7 @@ tryagain:
                                FAIL("Missing right brace on \\x{}");
                            else if (UTF) {
                                numlen = 1;     /* allow underscores */
-                               ender = (UV)scan_hex(p + 1, e - p, &numlen);
+                               ender = (UV)scan_hex(p + 1, e - p - 1, &numlen);
                                /* numlen is generous */
                                if (numlen + len >= 127) {
                                    p--;