Skip to content

Commit

Permalink
Merge pull request #20 from MaskRay/master
Browse files Browse the repository at this point in the history
Fix #19 segfault when --append to empty selection
  • Loading branch information
kfish authored Aug 24, 2017
2 parents aa7f57e + c641c79 commit 30fd5db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,12 +834,12 @@ get_selection_text (Atom selection)
static unsigned char *
copy_sel (unsigned char * s)
{
unsigned char * new_sel = NULL;

new_sel = xs_strdup (s);
current_alloc = total_input = xs_strlen (s);

return new_sel;
if (s) {
current_alloc = total_input = xs_strlen (s);
return xs_strdup (s);
}
current_alloc = total_input = 0;
return NULL;
}

/*
Expand Down

0 comments on commit 30fd5db

Please sign in to comment.