* src/stdbuf.c (main): Fix the array bounds check in the assert
* tests/misc/stdbuf: Add a test for all standard streams
case 'i':
case 'o':
opt_fileno = optc_to_fileno (c);
- assert (0 < opt_fileno && opt_fileno <= ARRAY_CARDINALITY (stdbuf));
+ assert (0 <= opt_fileno && opt_fileno < ARRAY_CARDINALITY (stdbuf));
stdbuf[opt_fileno].optc = c;
while (c_isspace (*optarg))
optarg++;
stdbuf -ol true && fail=1 # Capital 'L' required
stdbuf -o$SIZE_OFLOW true && fail=1 # size too large
stdbuf -iL true && fail=1 # line buffering stdin disallowed
+stdbuf -i0 -o0 -e0 true || fail=1 #check all files
# Ensure line buffering stdout takes effect
printf '1\n' > exp