assert(* *s == 'o');
(*s)++;
- if (**s != '{') {
+ if (send <= *s || **s != '{') {
*error_msg = "Missing braces on \\o{}";
return FALSE;
}
assert(*(*s - 1) == '\\');
assert(* *s == 'x');
+
(*s)++;
+ if (send <= *s) {
+ if (strict) {
+ *error_msg = "Empty \\x";
+ return FALSE;
+ }
+
+ /* Sadly, to preserve backcompat, an empty \x at the end of string is
+ * interpreted as a NUL */
+ *uv = 0;
+ return TRUE;
+ }
+
if (strict || ! output_warning) {
flags |= PERL_SCAN_SILENT_ILLDIGIT;
}
if (numbers_len == 0) {
if (strict) {
(*s)++; /* Move past the } */
- *error_msg = "Number with no digits";
+ *error_msg = "Empty \\x{}";
return FALSE;
}
*s = e + 1;