Fix off by one error in index limit calculation

Reported by:	Coverity
CID:		1193826
This commit is contained in:
truckman 2016-05-16 15:42:59 +00:00
parent 1b6b612801
commit 32ff5d5154

View File

@ -53,7 +53,7 @@ bsdstat_setfmt(struct bsdstat *sf, const char *fmt0)
"skipped\n", sf->name, tok);
continue;
}
if (j+3 > (int) sizeof(sf->fmts)) {
if (j+4 > (int) sizeof(sf->fmts)) {
fprintf(stderr, "%s: not enough room for all stats; "
"stopped at %s\n", sf->name, tok);
break;