commit d603a26

Michael Forney  ·  2014-02-27 02:54:53 +0000 UTC
parent 5ddd1da
Style
1 files changed,  +9, -7
+9, -7
 1@@ -43,8 +43,10 @@ static void offer_accept(struct wl_client * client,
 2     struct data * data = wl_resource_get_user_data(offer);
 3 
 4     /* Protect against expired data_offers being used. */
 5-    if (data)
 6-        wl_data_source_send_target(data->source, mime_type);
 7+    if (!data)
 8+        return;
 9+
10+    wl_data_source_send_target(data->source, mime_type);
11 }
12 
13 static void offer_receive(struct wl_client * client,
14@@ -54,11 +56,11 @@ static void offer_receive(struct wl_client * client,
15     struct data * data = wl_resource_get_user_data(offer);
16 
17     /* Protect against expired data_offers being used. */
18-    if (data)
19-    {
20-        wl_data_source_send_send(data->source, mime_type, fd);
21-        close(fd);
22-    }
23+    if (!data)
24+        return;
25+
26+    wl_data_source_send_send(data->source, mime_type, fd);
27+    close(fd);
28 }
29 
30 static void offer_destroy(struct wl_client * client,