X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fresources.c;h=e0925d0fc783792eb1403a835c916d218030ed2d;hb=72c1f4c1dc6ab07fe121a327ff1c30bf51ef74c1;hp=b24a8ea07c7855a3364b5c83b3991e303a8113ad;hpb=ce3185de9d9705e259f2b60dd4b5509007fa17d4;p=xscreensaver diff --git a/utils/resources.c b/utils/resources.c index b24a8ea0..e0925d0f 100644 --- a/utils/resources.c +++ b/utils/resources.c @@ -75,7 +75,7 @@ get_boolean_resource (char *res_name, char *res_class) if (!strcmp (buf,"off") || !strcmp (buf, "false") || !strcmp (buf,"no")) return 0; fprintf (stderr, "%s: %s must be boolean, not %s.\n", - progname, res_class, buf); + progname, res_name, buf); return 0; } @@ -159,14 +159,15 @@ get_pixel_resource (char *res_name, char *res_class, return color.pixel; DEFAULT: if (s) free (s); - return (strcmp (res_class, "Background") - ? WhitePixel (dpy, DefaultScreen (dpy)) - : BlackPixel (dpy, DefaultScreen (dpy))); + return ((strlen(res_class) >= 10 && + !strcmp ("Background", res_class + strlen(res_class) - 10)) + ? BlackPixel (dpy, DefaultScreen (dpy)) + : WhitePixel (dpy, DefaultScreen (dpy))); } int -parse_time (char *string, Bool seconds_default_p, Bool silent_p) +parse_time (const char *string, Bool seconds_default_p, Bool silent_p) { unsigned int h, m, s; char c;