diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index 1314e52..4ef25b8 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -3469,8 +3469,9 @@ SC_FUNC void check_tagmismatch_multiple(int formaltags[],int numtags,int actualt if (!checktag(formaltags, numtags, actualtag)) { int i; constvalue *tagsym; - char formal_tagnames[sLINEMAX]="",actual_tagname[sNAMEMAX+2]="none (\"_\")"; + char formal_tagnames[sLINEMAX+1]="",actual_tagname[sNAMEMAX+2]="none (\"_\")"; int notag_allowed=FALSE,add_comma=FALSE; + size_t size; for (i=0; iname : "-unknown-"); + size=snprintf(formal_tagnames, + sizeof(formal_tagnames), + "%s\"%s\"", + formal_tagnames, + (tagsym!=NULL) ? tagsym->name : "-unknown-"); + if (size>=sizeof(formal_tagnames)) + break; } else { notag_allowed=TRUE; } /* if */