From 38886de0c3e9ea5729ef23e4c653fa2822f52e8f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 6 Apr 2021 14:43:39 +0200 Subject: xscreensaver 6.00 --- driver/test-randr.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'driver/test-randr.c') diff --git a/driver/test-randr.c b/driver/test-randr.c index 74ead37..1f88d99 100644 --- a/driver/test-randr.c +++ b/driver/test-randr.c @@ -1,5 +1,5 @@ /* test-randr.c --- playing with the Resize And Rotate extension. - * xscreensaver, Copyright (c) 2004-2008 Jamie Zawinski + * xscreensaver, Copyright © 2004-2021 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -30,26 +30,9 @@ #include #include -char *progname = 0; +#include "blurb.h" char *progclass = "XScreenSaver"; -static const char * -blurb (void) -{ - static char buf[255]; - time_t now = time ((time_t *) 0); - char *ct = (char *) ctime (&now); - int n = strlen(progname); - if (n > 100) n = 99; - strncpy(buf, progname, n); - buf[n++] = ':'; - buf[n++] = ' '; - strncpy(buf+n, ct+11, 8); - strcpy(buf+n+9, ": "); - return buf; -} - - static Bool error_handler_hit_p = False; static int @@ -72,15 +55,15 @@ main (int argc, char **argv) Widget toplevel_shell = XtAppInitialize (&app, progclass, 0, 0, &argc, argv, 0, 0, 0); Display *dpy = XtDisplay (toplevel_shell); - XtGetApplicationNameAndClass (dpy, &progname, &progclass); + progname = argv[0]; nscreens = ScreenCount(dpy); if (!XRRQueryExtension(dpy, &event_number, &error_number)) { fprintf(stderr, "%s: XRRQueryExtension(dpy, ...) ==> False\n", blurb()); - fprintf(stderr, "%s: server does not support the RANDR extension.\n", + fprintf(stderr, "%s: server does not support the RANDR extension\n", blurb()); major = -1; } -- cgit v1.2.3-55-g7522