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:
parent
0ed5f7aacd
commit
58adbb5505
@ -126,7 +126,8 @@ int shuf_main(int argc, char **argv)
|
|||||||
fclose_if_not_stdin(fp);
|
fclose_if_not_stdin(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
shuffle_lines(lines, numlines);
|
if (numlines != 0)
|
||||||
|
shuffle_lines(lines, numlines);
|
||||||
|
|
||||||
if (opts & OPT_o)
|
if (opts & OPT_o)
|
||||||
xmove_fd(xopen(opt_o_str, O_WRONLY|O_CREAT|O_TRUNC), STDOUT_FILENO);
|
xmove_fd(xopen(opt_o_str, O_WRONLY|O_CREAT|O_TRUNC), STDOUT_FILENO);
|
||||||
|
Loading…
Reference in New Issue
Block a user