From 363bc123d077d764cb73556e95b05d8fe1a8b1f8 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Mon, 9 Sep 2019 23:53:10 +0200 Subject: uri_collection needs to hold one more item than max Because the last item needs to be NULL and is written in `drag_data_get`. --- dragon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dragon.c') diff --git a/dragon.c b/dragon.c index fca077c..debe087 100644 --- a/dragon.c +++ b/dragon.c @@ -393,8 +393,8 @@ int main (int argc, char **argv) { exit(0); } - if(drag_all){ - uri_collection = malloc(sizeof(char*) * (argc > MAX_SIZE? argc: MAX_SIZE)); + if (drag_all) { + uri_collection = malloc(sizeof(char*) * ((argc > MAX_SIZE ? argc : MAX_SIZE) + 1)); uri_count = 0; } -- cgit