Fix faulty assert

It is allowed for symbol names to be up to sNAMEMAX characters but
the assert() restricted them to sNAMEMAX-1 characters, so it would
fail for any long enough name.

Ran across this investigating #21.
This commit is contained in:
Zeex 2014-03-16 12:40:34 +07:00
parent 53ef10ffc7
commit a272a7e43e

View File

@ -4737,7 +4737,7 @@ static constvalue *insert_constval(constvalue *prev,constvalue *next,const char
error(103); /* insufficient memory (fatal error) */ error(103); /* insufficient memory (fatal error) */
memset(cur,0,sizeof(constvalue)); memset(cur,0,sizeof(constvalue));
if (name!=NULL) { if (name!=NULL) {
assert(strlen(name)<sNAMEMAX); assert(strlen(name)<sNAMEMAX+1);
strcpy(cur->name,name); strcpy(cur->name,name);
} /* if */ } /* if */
cur->value=val; cur->value=val;