Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Prior

to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown
blocksize" as expected, but sometimes also "maximum blocksize is 1G"
and "minimum blocksize is 512" depending on what happened to be on
the stack.

Found by:	LLVM/Clang Static Checker
This commit is contained in:
Colin Percival 2008-08-04 06:53:13 +00:00
parent d59e8ae886
commit cb8330d036

View File

@ -83,6 +83,7 @@ getbsize(headerlenp, blocksizep)
default:
fmterr: warnx("%s: unknown blocksize", p);
n = 512;
max = MAXB;
mul = 1;
break;
}