summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parse.y b/src/parse.y
index af12112c7..cffb6ba09 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3329,7 +3329,7 @@ read_escape(parser_state *p)
break;
}
}
- c = scan_hex(buf, i+1, &i);
+ c = scan_hex(buf, i, &i);
if (i == 0) {
yyerror(p, "Invalid escape character syntax");
return 0;
@@ -4747,13 +4747,14 @@ mrb_parser_new(mrb_state *mrb)
{
mrb_pool *pool;
parser_state *p;
+ static const parser_state parser_state_zero = { 0 };
pool = mrb_pool_open(mrb);
if (!pool) return 0;
p = (parser_state *)mrb_pool_alloc(pool, sizeof(parser_state));
if (!p) return 0;
- memset(p, 0, sizeof(parser_state));
+ *p = parser_state_zero;
p->mrb = mrb;
p->pool = pool;
p->in_def = p->in_single = 0;