Subject: [PATCH] ClockFormat in FvwmTaskBar

From: Guillaume Chazarain <[email-masked]>
Date: Mon, 01 Sep 2003 13:30:28 +0200

Hello,

I have hit the 24 characters limit for ClockFormat in FvwmTaskBar.
Why not increase the limit to 255, and in DateFormat as well?
Moreover, I don't understand why all these variables are declared
static.
The appended patch works fine for me.

Regards,
Guillaume.

--- fvwm-snap-20030814/modules/FvwmTaskBar/FvwmTaskBar.1
+++ fvwm-snap-20030814-patched/modules/FvwmTaskBar/FvwmTaskBar.1
@@ -271,13 +271,13 @@
 .IP "*FvwmTaskBar: ClockFormat \fIformat-string\fP"
 This option specifies the time format for the digital clock.
 It is a \fIstrftime(3)\fP compatible format string.
-By default it is "%R". There is a 24 character limit for string
+By default it is "%R". There is a 255 character limit for string
 expansion. The string depends of locale settings.
 
 .IP "*FvwmTaskBar: DateFormat \fIformat-string\fP"
 This option specifies the date and/or time format for clock tip.
 It is a \fIstrftime(3)\fP compatible format string.
-By default it is "%A, %B %d, %Y". There is 40 characters limit for
+By default it is "%A, %B %d, %Y". There is 255 characters limit for
 string expansion. The string depends of locale settings now.
 
 .IP "*FvwmTaskBar: UpdateInterval \fIseconds\fP"
--- fvwm-snap-20030814/modules/FvwmTaskBar/Goodies.c
+++ fvwm-snap-20030814-patched/modules/FvwmTaskBar/Goodies.c
@@ -297,11 +297,11 @@
 		else
 		{
 			struct tm *tms;
-			static time_t timer;
-			static char str[24];
+			time_t timer;
+			char str[256];
 			time(&timer);
 			tms = localtime(&timer);
-			strftime(str, 24, clockfmt, tms);
+			strftime(str, 256, clockfmt, tms);
 			clock_width = FlocaleTextWidth(
 				FStatusFont, str, strlen(str)) + 4;
 		}
@@ -345,8 +345,8 @@
 {
 	XRectangle rect;
 	struct tm *tms;
-	static char str[40];
-	static time_t timer;
+	char str[256];
+	time_t timer;
 	static int last_mail_check = -1;
 	int x = win_width - stwin_width;
 	int y = 0;
@@ -380,12 +380,12 @@
 	tms = localtime(&timer);
 	if (clockfmt)
 	{
-		strftime(str, 24, clockfmt, tms);
+		strftime(str, 256, clockfmt, tms);
 		if (str[0] == '0') str[0]=' ';
 	}
 	else
 	{
-		strftime(str, 15, "%R", tms);
+		strftime(str, 256, "%R", tms);
 	}
 
 	Draw3dBox(win, x, y, w, h, &rect);
@@ -472,15 +472,15 @@
 void CreateDateWindow(void)
 {
   struct tm *tms;
-  static time_t timer;
-  static char str[40];
+  time_t timer;
+  char str[256];
 
   time(&timer);
   tms = localtime(&timer);
   if (datefmt) {
-    strftime(str, 40, datefmt, tms);
+    strftime(str, 256, datefmt, tms);
   } else {
-    strftime(str, 40, "%A, %B %d, %Y", tms);
+    strftime(str, 256, "%A, %B %d, %Y", tms);
   }
   last_date = tms->tm_mday;

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]