X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fimsmap.c;h=fad6a8ca4dedf993df6257e681277f1ef84c60c4;hb=96a411663168b0ba5432b407a83be55f3df0c802;hp=f89f95fede33925458a1d8262c4fbab7171f33bb;hpb=c596d1306f5f92f7eab76224d3b049980a14adcb;p=xscreensaver diff --git a/hacks/imsmap.c b/hacks/imsmap.c index f89f95fe..fad6a8ca 100644 --- a/hacks/imsmap.c +++ b/hacks/imsmap.c @@ -16,6 +16,7 @@ #include #include +#include #include /* for gettimeofday() */ #include @@ -77,6 +78,7 @@ init_map (Display *dpy, Window window) if (ncolors <= 2) ncolors = 0; if (ncolors == 0) mono_p = True; + if (ncolors > 255) ncolors = 255; /* too many look bad */ fg_pixel = get_pixel_resource ("background", "Background", dpy, cmap); bg_pixel = get_pixel_resource ("foreground", "Foreground", dpy, cmap); @@ -417,7 +419,7 @@ draw_map (Display *dpy, Window window) if (cycle_p) { struct timeval now; - static struct timeval then = { 0, }; + static struct timeval then = { 0, 0 }; unsigned long diff; #ifdef GETTIMEOFDAY_TWO_ARGS struct timezone tzp;