aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-05 07:51:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-05 07:51:10 +0000
commitdd57418494196f83f164ea075e87ba9ad5d0ebb6 (patch)
treeedd05c3f3209ddb6899d244f240b93f8826dbbc7 /selection.c
parentselection: text_from_{clipboard,primary}: add 'done' callback (diff)
selection: initialize 'ctx' before jumping into its scope
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/selection.c b/selection.c
index bd9d76fb..9dddf365 100644
--- a/selection.c
+++ b/selection.c
@@ -328,11 +328,11 @@ struct clipboard_send {
static bool
fdm_send(struct fdm *fdm, int fd, int events, void *data)
{
+ struct clipboard_send *ctx = data;
+
if (events & EPOLLHUP)
goto done;
- struct clipboard_send *ctx = data;
-
switch (async_write(fd, ctx->data, ctx->len, &ctx->idx)) {
case ASYNC_WRITE_REMAIN:
return true;