1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-27 21:29:02 +00:00
freebsd-ports/deskutils/xcalendar/files/patch-aa
Jun Kuriyama 98116ff0ca Add xcalendar 4.0,
a calendar with a notebook for X11
(internationarized version).

PR:		ports/25739
Submitted by:	MITA Yoshio <mita@iis.u-tokyo.ac.jp>
2001-03-16 02:37:16 +00:00

42 lines
846 B
Plaintext

--- xcalendar.c.dist Tue Jul 4 06:59:01 1995
+++ xcalendar.c Mon Mar 12 20:53:10 2001
@@ -1091,10 +1091,10 @@
struct tm *
gettime()
{
- struct timeval t;
+ time_t now;
- gettimeofday(&t, NULL);
- today = localtime(&t.tv_sec);
+ (void) time(&now);
+ today = localtime(&now);
return today;
}
@@ -1827,8 +1827,8 @@
*sb++ = '1', *sb++ = '9';
/* fall thru */
case 'y':
- *sb++ = tm.tm_year / 10 + '0';
- *sb++ = tm.tm_year % 10 + '0';
+ *sb++ = (tm.tm_year%100) / 10 + '0';
+ *sb++ = (tm.tm_year%100) % 10 + '0';
break;
case '%':
*sb++ = *p;
@@ -1869,6 +1869,13 @@
if (len == -1)
return;
}
+
+ /* terminate `buf' with NULL */
+ if (sizeof(buf) == len) {
+ buf = XtRealloc(buf, len + 1);
+ }
+ buf[len] = NULL;
+
start = buf;
while (len > 0) {