diff options
Diffstat (limited to 'utils/colors.c')
-rw-r--r-- | utils/colors.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/colors.c b/utils/colors.c index 5445cd6..01f8fc6 100644 --- a/utils/colors.c +++ b/utils/colors.c @@ -393,11 +393,13 @@ make_color_path (Screen *screen, Visual *visual, Colormap cmap, if (k <= 0) return; # else - for (i = k+1; i < *ncolorsP; i++) + if (k <= 0) + return; + for (i = k; i < *ncolorsP; i++) /* #### Should duplicate the allocation of the color cell here to avoid a double-color-free on PseudoColor, but it's 2018 and I don't care, */ - colors[i] = colors[k]; + colors[i] = colors[i-1]; # endif } |