shuf: fix a segfault on 'shuf -e'

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Bartosz Golaszewski 2014-03-07 11:46:03 +01:00 committed by Denys Vlasenko
parent 0ed5f7aacd
commit 58adbb5505

View File

@ -126,6 +126,7 @@ int shuf_main(int argc, char **argv)
fclose_if_not_stdin(fp);
}
if (numlines != 0)
shuffle_lines(lines, numlines);
if (opts & OPT_o)