- if (XAllocColor (display, colormap, color_def) != 0) {
- status = 2;
- } else {
- status = 0; /* JH: how does this happen??? DOES this happen??? */
- fprintf(stderr,"allocate_nearest_color returned 0!!!\n");
- }
+ if (XAllocColor (display, colormap, color_def) != 0)
+ status = 2;
+ else
+ /* LSK: Either the colour map has changed since
+ * we read it, or the colour is allocated
+ * read/write... Mark this cmap entry so it's
+ * ignored in the next iteration.
+ */
+ cells[nearest].pixel = ULONG_MAX;