swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit d603a266d20665aa2aba9f2df94cdbaa0ba3292e
parent 5ddd1dad86765fe523fecd65b3c18f7d4f96b790
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 26 Feb 2014 18:54:53 -0800

Style

Diffstat:
Mlibswc/data.c | 16+++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/libswc/data.c b/libswc/data.c @@ -43,8 +43,10 @@ static void offer_accept(struct wl_client * client, struct data * data = wl_resource_get_user_data(offer); /* Protect against expired data_offers being used. */ - if (data) - wl_data_source_send_target(data->source, mime_type); + if (!data) + return; + + wl_data_source_send_target(data->source, mime_type); } static void offer_receive(struct wl_client * client, @@ -54,11 +56,11 @@ static void offer_receive(struct wl_client * client, struct data * data = wl_resource_get_user_data(offer); /* Protect against expired data_offers being used. */ - if (data) - { - wl_data_source_send_send(data->source, mime_type, fd); - close(fd); - } + if (!data) + return; + + wl_data_source_send_send(data->source, mime_type, fd); + close(fd); } static void offer_destroy(struct wl_client * client,