summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-09-29 16:52:48 +0000
committerJim Meyering <jim@meyering.net>2006-09-29 16:52:48 +0000
commita38becce9752e67f71e79e8c230b327869802e70 (patch)
treedfcc3eb484617775b630eb08486ec656d88948c4 /src
parent31c77a2fde27888aead246cde6eb88724450e5e1 (diff)
downloadcoreutils-a38becce9752e67f71e79e8c230b327869802e70.tar.xz
* src/shuf.c (read_input): Fix an off-by-one error that
would cause an infloop for piped input of 8KB or more. * NEWS: Mention the fix. * tests/misc/shuf: Test for the above fix.
Diffstat (limited to 'src')
-rw-r--r--src/shuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shuf.c b/src/shuf.c
index 39cfdfffb..68003c259 100644
--- a/src/shuf.c
+++ b/src/shuf.c
@@ -178,7 +178,7 @@ read_input (FILE *in, char eolbyte, char ***pline)
do
{
- if (alloc == used)
+ if (alloc <= used + 1)
{
if (alloc == SIZE_MAX)
xalloc_die ();