diff options
author | dholland <dholland@pkgsrc.org> | 2012-12-16 20:34:08 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2012-12-16 20:34:08 +0000 |
commit | a9f8e4b3593f1912f1546fda05cc65e211465c94 (patch) | |
tree | 7a694e83b71ac3fe8708157d675a36ff75561ac3 /games | |
parent | 2659165d3294591a97741f66c8d1a6d95903636c (diff) | |
download | pkgsrc-a9f8e4b3593f1912f1546fda05cc65e211465c94.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/distinfo | 3 | ||||
-rw-r--r-- | games/nethack-lib/patches/patch-util_makedefs.c | 39 |
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, |