terminal.c: Check if fdopen() fails
If fdopen() fails we just close the fd and return, failing the copy-and-paste. Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
34be0608c7
commit
1bf14815ef
@@ -841,6 +841,10 @@ terminal_send_selection(struct terminal *terminal, int fd)
|
|||||||
int len;
|
int len;
|
||||||
|
|
||||||
fp = fdopen(fd, "w");
|
fp = fdopen(fd, "w");
|
||||||
|
if (fp == NULL){
|
||||||
|
close(fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (row = 0; row < terminal->height; row++) {
|
for (row = 0; row < terminal->height; row++) {
|
||||||
p_row = terminal_get_row(terminal, row);
|
p_row = terminal_get_row(terminal, row);
|
||||||
for (col = 0; col < terminal->width; col++) {
|
for (col = 0; col < terminal->width; col++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user