aboutsummaryrefslogtreecommitdiffstats
path: root/x11-clocks
diff options
context:
space:
mode:
authorade <ade@FreeBSD.org>2000-01-05 04:43:49 +0800
committerade <ade@FreeBSD.org>2000-01-05 04:43:49 +0800
commitfa1bb6d2149b83e802f97ee49d7c9eb4c4cdb13e (patch)
treef904a9d40c1e8fd992e6c49b0e68e12955a9a2ec /x11-clocks
parent3e1fe66f009346464932d330072ab656ec6ed8e5 (diff)
downloadfreebsd-ports-gnome-fa1bb6d2149b83e802f97ee49d7c9eb4c4cdb13e.tar.gz
freebsd-ports-gnome-fa1bb6d2149b83e802f97ee49d7c9eb4c4cdb13e.tar.zst
freebsd-ports-gnome-fa1bb6d2149b83e802f97ee49d7c9eb4c4cdb13e.zip
Fix Y2K problem.
Discovered by: The Unicorn <unicorn@blackhats.org>
Diffstat (limited to 'x11-clocks')
-rw-r--r--x11-clocks/dclock/files/patch-ad27
1 files changed, 27 insertions, 0 deletions
diff --git a/x11-clocks/dclock/files/patch-ad b/x11-clocks/dclock/files/patch-ad
new file mode 100644
index 000000000000..2ff8cbfb2954
--- /dev/null
+++ b/x11-clocks/dclock/files/patch-ad
@@ -0,0 +1,27 @@
+--- Dclock.c.orig Tue Jan 4 14:01:53 2000
++++ Dclock.c Tue Jan 4 14:01:55 2000
+@@ -967,7 +967,7 @@
+ {
+ char datestr[128];
+ register char *datep = datestr, *p;
+- int x;
++ int x, year = now->tm_year + 1900;
+
+ if (!w->dclock.display_time)
+ datep += strlen(strcpy(datep, "Push HERE to Set/Unset Alarm"));
+@@ -1000,11 +1000,12 @@
+ *datep++ = (now->tm_mday / 10 + '0');
+ *datep++ = now->tm_mday % 10 + '0';
+ when 'Y':
+- *datep++ = '1', *datep++ = '9';
++ *datep++ = (year / 1000) % 10 + '0';
++ *datep++ = (year / 100) % 10 + '0';
+ /* fall thru */
+ case 'y':
+- *datep++ = now->tm_year / 10 + '0';
+- *datep++ = now->tm_year % 10 + '0';
++ *datep++ = (year / 10) % 10 + '0';
++ *datep++ = year % 10 + '0';
+ when '%':
+ *datep++ = *p;
+ otherwise: ; /* nothing */