Fix stinit file parsing broken in 874d58d9

For some reason I missed this during the pull request (even if
trivial), thanks travis-ci for letting me know (indirectly :).

Fixes #14.
This commit is contained in:
Iustin Pop
2019-10-13 20:14:39 +02:00
parent c73d6ee0e5
commit d5720ee85e

View File

@@ -316,6 +316,7 @@ find_pars(FILE *dbf, char *company, char *product, char *rev, devdef_tr *defs, i
SKIP_WHITE(comptr);
for (; *nextdef != '\0';) {
int tmpsize;
curdef = nextdef;
SKIP_WHITE(curdef);
for (nextdef++;
@@ -334,7 +335,14 @@ find_pars(FILE *dbf, char *company, char *product, char *rev, devdef_tr *defs, i
continue;
}
snprintf(defstr, sizeof(defstr) / sizeof(char), "%s%s", comptr, cp);
if ((tmpsize = snprintf(modebuf, DEFMAX, "%s%s", comptr, cp)) >= DEFMAX) {
fprintf(stderr, "Definition too large for ('%s', '%s', '%s'): size %d, maximum is %d\n",
tmpcomp, tmpprod, tmprev, tmpsize, DEFMAX);
*nextdef = c;
errors++;
continue;
}
*nextdef = c;
if (verbose > 1)