aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/ImageControl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc
index 00f566d..a5e5cd1 100644
--- a/src/FbTk/ImageControl.cc
+++ b/src/FbTk/ImageControl.cc
@@ -111,14 +111,14 @@ void allocateUnallocatedColors(std::vector<XColor> colors, Display* dpy, Colorma
111 // 'icolors' will hold the first 'nr_icolors' colors of the 111 // 'icolors' will hold the first 'nr_icolors' colors of the
112 // given (indexed) colormap. 112 // given (indexed) colormap.
113 const size_t nr_icolors = std::min(256, 1 << screen_depth); 113 const size_t nr_icolors = std::min(256, 1 << screen_depth);
114 XColor icolors[nr_icolors]; 114 std::vector<XColor> icolors(nr_icolors);
115 115
116 // give each icolor an index 116 // give each icolor an index
117 for (i = 0; i < nr_icolors; i++) 117 for (i = 0; i < nr_icolors; i++)
118 icolors[i].pixel = i; 118 icolors[i].pixel = i;
119 119
120 // query the colors of the colormap and store them into 'icolors' 120 // query the colors of the colormap and store them into 'icolors'
121 XQueryColors(dpy, cmap, icolors, nr_icolors); 121 XQueryColors(dpy, cmap, &icolors[0], nr_icolors);
122 122
123 // try to find a close color for all not allocated colors 123 // try to find a close color for all not allocated colors
124 for (i = 0; i < colors.size(); i++) { 124 for (i = 0; i < colors.size(); i++) {