From: Andreas Fink Date: Wed, 30 Sep 2009 17:52:32 +0000 (+0000) Subject: *fix* using variable length array looks even better X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=55074ddda0777cfdefa9029c2bab5ca895c5a30c;p=chaz%2Ftint2 *fix* using variable length array looks even better --- diff --git a/src/taskbar/task.c b/src/taskbar/task.c index c366ff6..6fce7e6 100644 --- a/src/taskbar/task.c +++ b/src/taskbar/task.c @@ -201,12 +201,11 @@ void get_icon (Task *tsk) tmp_data = get_best_icon (data, get_icon_count (data, i), i, &w, &h, panel->g_task.icon_size1); #ifdef __x86_64__ - DATA32 *icon_data = malloc (w * h * sizeof (DATA32)); + DATA32 icon_data[w * h]; int length = w * h; for (i = 0; i < length; ++i) icon_data[i] = tmp_data[i]; - img = imlib_create_image_using_copied_data (w, h, icon_data); - free(icon_data); + img = imlib_create_image_using_data (w, h, icon_data); #else img = imlib_create_image_using_data (w, h, (DATA32*)tmp_data); #endif