summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authordholland <dholland>2012-12-16 20:34:08 +0000
committerdholland <dholland>2012-12-16 20:34:08 +0000
commited5b715a88f046d44b4f4ebd956722b41e2fb6a6 (patch)
tree7a694e83b71ac3fe8708157d675a36ff75561ac3 /games
parent18031d9cb19502bc29832123ce653bffeca6d0b0 (diff)
downloadpkgsrc-ed5b715a88f046d44b4f4ebd956722b41e2fb6a6.tar.gz
Remove illegal time_t casts. Should fix build SIGSEGV on 32 bit netbsd.
Diffstat (limited to 'games')
-rw-r--r--games/nethack-lib/distinfo3
-rw-r--r--games/nethack-lib/patches/patch-util_makedefs.c39
2 files changed, 41 insertions, 1 deletions
diff --git a/games/nethack-lib/distinfo b/games/nethack-lib/distinfo
index fd1f97b2eb2..6a8432a1c65 100644
--- a/games/nethack-lib/distinfo
+++ b/games/nethack-lib/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2011/06/01 11:20:29 wiz Exp $
+$NetBSD: distinfo,v 1.18 2012/12/16 20:34:08 dholland Exp $
SHA1 (nethack-343-src.tgz) = c26537093c38152bc0fbcec20468d975b35f59fd
RMD160 (nethack-343-src.tgz) = 42f600d24715a0b7e631b357c135761410b3ca95
@@ -13,3 +13,4 @@ SHA1 (patch-ag) = 5bf322fb92a3cd9df9559e56265f0477d9e92487
SHA1 (patch-ai) = 73c5b2ea1227531089474705f2f18bc411366365
SHA1 (patch-sys_unix_Makefile.src) = 003f16fba997ac61efc92adecc13b883135a86bc
SHA1 (patch-sys_unix_Makefile.utl) = 409e1f8b58c7e2709d224f42c19fdfd162d9cea7
+SHA1 (patch-util_makedefs.c) = 63faf92a7f511fcf73317789a3008350cdd404d9
diff --git a/games/nethack-lib/patches/patch-util_makedefs.c b/games/nethack-lib/patches/patch-util_makedefs.c
new file mode 100644
index 00000000000..5a552c0656f
--- /dev/null
+++ b/games/nethack-lib/patches/patch-util_makedefs.c
@@ -0,0 +1,39 @@
+$NetBSD: patch-util_makedefs.c,v 1.1 2012/12/16 20:34:08 dholland Exp $
+
+Remove illegal casts, avoiding undefined behavior and resulting
+SIGSEGV during build.
+
+--- util/makedefs.c~ 2003-12-07 23:39:13.000000000 +0000
++++ util/makedefs.c
+@@ -543,7 +543,7 @@ const char *build_date;
+ void
+ do_date()
+ {
+- long clocktim = 0;
++ time_t clocktim = 0;
+ char *c, cbuf[60], buf[BUFSZ];
+ const char *ul_sfx;
+
+@@ -559,13 +559,8 @@ do_date()
+ Fprintf(ofp,"/*\tSCCS Id: @(#)date.h\t3.4\t2002/02/03 */\n\n");
+ Fprintf(ofp,Dont_Edit_Code);
+
+-#ifdef KR1ED
+ (void) time(&clocktim);
+ Strcpy(cbuf, ctime(&clocktim));
+-#else
+- (void) time((time_t *)&clocktim);
+- Strcpy(cbuf, ctime((time_t *)&clocktim));
+-#endif
+ for (c = cbuf; *c; c++) if (*c == '\n') break;
+ *c = '\0'; /* strip off the '\n' */
+ Fprintf(ofp,"#define BUILD_DATE \"%s\"\n", cbuf);
+@@ -595,7 +590,7 @@ do_date()
+ Fprintf(ofp,"\n");
+ #ifdef AMIGA
+ {
+- struct tm *tm = localtime((time_t *) &clocktim);
++ struct tm *tm = localtime(&clocktim);
+ Fprintf(ofp,"#define AMIGA_VERSION_STRING ");
+ Fprintf(ofp,"\"\\0$VER: NetHack %d.%d.%d (%d.%d.%d)\"\n",
+ VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL,