From 3bedc65d2b442ed67c3d9abce97994d3c7a0bd6d Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 1 Mar 2014 00:20:19 +0900 Subject: [PATCH] use yyrealloc --- src/parse.y | 2 +- src/scan.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse.y b/src/parse.y index f9b3e5d5..ffa1259b 100644 --- a/src/parse.y +++ b/src/parse.y @@ -145,7 +145,7 @@ void yyerror(struct parser_control *, const char *); char c; struct { char *dat; - int len, capa; + size_t len, capa; } blob; pic_value datum; } diff --git a/src/scan.l b/src/scan.l index e03ad0cd..aad0ca49 100644 --- a/src/scan.l +++ b/src/scan.l @@ -164,7 +164,7 @@ infnan "+inf.0"|"-inf.0"|"+nan.0"|"-nan.0" yylvalp->blob.dat[yylvalp->blob.len++] = (char)i; if (yylvalp->blob.len > yylvalp->blob.capa) { yylvalp->blob.capa *= 2; - yylvalp->blob.dat = realloc(yylvalp->blob.dat, yylvalp->blob.capa); + yylvalp->blob.dat = yyrealloc(yylvalp->blob.dat, yylvalp->blob.capa, yyscanner); } } ")" {