diff options
author | Pádraig Brady <P@draigBrady.com> | 2009-06-27 01:48:49 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2009-06-27 02:21:43 +0100 |
commit | 1c16c9598e67e0db641af8b85abf8c009e3a9226 (patch) | |
tree | 2609c19bad26c161fb8ea9b123ceffbf03d4bd02 /src | |
parent | 9c6c621c324148b13216cfc9bcb35e81eb151d50 (diff) | |
download | coreutils-1c16c9598e67e0db641af8b85abf8c009e3a9226.tar.xz |
stdbuf: fix to stop -i option causing an assertion
* src/stdbuf.c (main): Fix the array bounds check in the assert
* tests/misc/stdbuf: Add a test for all standard streams
Diffstat (limited to 'src')
-rw-r--r-- | src/stdbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdbuf.c b/src/stdbuf.c index 89f2242de..5da934191 100644 --- a/src/stdbuf.c +++ b/src/stdbuf.c @@ -319,7 +319,7 @@ main (int argc, char **argv) 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++; |