Fix off by one error in index limit calculation

Reported by:	Coverity
CID:		1193826
This commit is contained in:
Don Lewis 2016-05-16 15:42:59 +00:00
parent 9c3e205296
commit 41cee4e41b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299950

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;