aboutsummaryrefslogtreecommitdiff
path: root/dragon.c
diff options
context:
space:
mode:
authorFichteFoll <fichtefoll2@googlemail.com>2019-11-02 00:52:32 +0100
committerMichael Homer <mwh@ecs.vuw.ac.nz>2019-11-02 12:58:18 +1300
commit3e43b3cca309a504eba059f4c8d44cf3547d48f3 (patch)
treec357c316520a36ca33d5f1f514f64f1e4d485384 /dragon.c
parentAllow ASK drag action (diff)
downloaddragon-3e43b3cca309a504eba059f4c8d44cf3547d48f3.tar.gz
dragon-3e43b3cca309a504eba059f4c8d44cf3547d48f3.tar.bz2
dragon-3e43b3cca309a504eba059f4c8d44cf3547d48f3.zip
Prevent segfault when dragging a single item
Diffstat (limited to 'dragon.c')
-rw-r--r--dragon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dragon.c b/dragon.c
index 062cbd6..8448f21 100644
--- a/dragon.c
+++ b/dragon.c
@@ -53,6 +53,7 @@ struct draggable_thing {
// MODE_ALL
#define MAX_SIZE 100
char** uri_collection;
+char** single_uri_data;
int uri_count;
bool drag_all = false;
// ---
@@ -84,8 +85,9 @@ void drag_data_get(GtkWidget *widget,
uri_collection[uri_count] = NULL;
uris = uri_collection;
} else {
- char* a[] = {dd->uri, NULL};
- uris = a;
+ single_uri_data[0] = dd->uri;
+ single_uri_data[1] = NULL;
+ uris = single_uri_data;
}
if (verbose) {
if (drag_all)
@@ -388,6 +390,7 @@ int main (int argc, char **argv) {
}
}
setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
+ single_uri_data = malloc(sizeof(char*) * 2);
GtkAccelGroup *accelgroup;
GClosure *closure;
bgstack15