diff --git a/deskutils/xcalendar/Makefile b/deskutils/xcalendar/Makefile index 9fbf6755b886..1366464c344c 100644 --- a/deskutils/xcalendar/Makefile +++ b/deskutils/xcalendar/Makefile @@ -1,18 +1,18 @@ PORTNAME= xcalendar PORTVERSION= 4.0.2008 PORTREVISION= 2 CATEGORIES= deskutils MASTER_SITES= PORTS_JP DISTNAME= ${PORTNAME}-4.0+i18n -MAINTAINER= ports@FreeBSD.org +MAINTAINER= cy@FreeBSD.org COMMENT= Calendar with a notebook for X11 (internationalized version) WRKSRC= ${WRKDIR}/${PORTNAME} USES= imake gmake xorg USE_XORG= ice sm x11 xaw xext xmu xt MAKE_ENV= FILESDIR=${FILESDIR} ALL_TARGET= all XCal-uj.ad xcalendar-uj.hlp xcalendar-uj.man .include diff --git a/deskutils/xcalendar/files/patch-xcalendar.c b/deskutils/xcalendar/files/patch-xcalendar.c index a36973d4be28..f69841d25245 100644 --- a/deskutils/xcalendar/files/patch-xcalendar.c +++ b/deskutils/xcalendar/files/patch-xcalendar.c @@ -1,41 +1,41 @@ ---- xcalendar.c.dist Tue Jul 4 06:59:01 1995 -+++ xcalendar.c Mon Mar 12 20:53:10 2001 +--- xcalendar.c.orig 1995-07-03 14:59:01.000000000 -0700 ++++ xcalendar.c 2023-04-30 21:04:24.168420000 -0700 @@ -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; ++ buf[len] = 0; + start = buf; while (len > 0) { diff --git a/deskutils/xcalendar/files/patch-xcalendar.h b/deskutils/xcalendar/files/patch-xcalendar.h index 5aeac0376726..65c4e614757e 100644 --- a/deskutils/xcalendar/files/patch-xcalendar.h +++ b/deskutils/xcalendar/files/patch-xcalendar.h @@ -1,11 +1,11 @@ ---- xcalendar.h.orig Sun Oct 1 12:21:42 1995 -+++ xcalendar.h Mon Mar 12 20:54:02 2001 +--- xcalendar.h.orig 1995-09-30 20:21:42.000000000 -0700 ++++ xcalendar.h 2023-04-30 21:02:14.402254000 -0700 @@ -75,7 +75,7 @@ #include #endif -#if defined(SYSV) || defined(__osf__) || defined(SVR4) +#if defined(SYSV) || defined(__osf__) || defined(SVR4) || defined(HAVE_DIRENT_H) #include #else #include