projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
masterをマージ
[YACASL2.git]
/
src
/
token.c
diff --git
a/src/token.c
b/src/token.c
index
3ea2073
..
2757a7b
100644
(file)
--- 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;
{
OPD *opd = malloc(sizeof(OPD));
char *p, *q, *sepp;
- int sepc = ',',
qcnt
= 0;
+ int sepc = ',',
len
= 0;
bool quoting = false;
opd->opdc = 0;
bool quoting = false;
opd->opdc = 0;
@@
-32,7
+32,7
@@
OPD *opdtok(const char *str)
}
/* 「'」の分、文字列の長さを小さくする */
if(*(q+1) != '\'') {
}
/* 「'」の分、文字列の長さを小さくする */
if(*(q+1) != '\'') {
-
qcnt++
;
+
len--
;
}
}
if(quoting == true) {
}
}
if(quoting == true) {
@@
-50,13
+50,13
@@
OPD *opdtok(const char *str)
setcerr(121, NULL); /* cannot get operand token */
break;
}
setcerr(121, NULL); /* cannot get operand token */
break;
}
- if(strlen(p) - qcnt > OPDSIZE) {
+ len += strlen(p);
+ if(len > OPDSIZE) {
setcerr(118, NULL); /* operand length is too long */
break;
}
opd->opdv[(++opd->opdc)-1] = strdup(p);
p = q = sepp + 1;
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;
}
} while(sepc == ',');
return opd;