From 992a77b00c9ac733943cefffb85894604b9a4ba4 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Wed, 10 Feb 2010 23:25:30 +0900 Subject: [PATCH] =?utf8?q?=E3=82=AA=E3=83=9A=E3=83=A9=E3=83=B3=E3=83=89?= =?utf8?q?=E9=95=B7=E5=8F=96=E5=BE=97=E6=99=82=E3=81=AE=E3=83=90=E3=82=B0?= =?utf8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/token.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/token.c b/src/token.c index 2757a7b..3ea2073 100644 --- a/src/token.c +++ b/src/token.c @@ -6,7 +6,7 @@ OPD *opdtok(const char *str) { OPD *opd = malloc(sizeof(OPD)); char *p, *q, *sepp; - int sepc = ',', len = 0; + int sepc = ',', qcnt = 0; bool quoting = false; opd->opdc = 0; @@ -32,7 +32,7 @@ OPD *opdtok(const char *str) } /* 「'」の分、文字列の長さを小さくする */ if(*(q+1) != '\'') { - len--; + qcnt++; } } if(quoting == true) { @@ -50,13 +50,13 @@ OPD *opdtok(const char *str) setcerr(121, NULL); /* cannot get operand token */ break; } - len += strlen(p); - if(len > OPDSIZE) { + if(strlen(p) - qcnt > OPDSIZE) { setcerr(118, NULL); /* operand length is too long */ break; } opd->opdv[(++opd->opdc)-1] = strdup(p); p = q = sepp + 1; + qcnt = 0; } } while(sepc == ','); return opd; -- 2.18.0