Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2009 17:50:07 GMT
From:      Ulrich Spoerlein <uspoerlein@gmail.com>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/127728: ports/games/freebsd-games doesn't build, and larn(6) segfaults!
Message-ID:  <200907211750.n6LHo7el075989@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/127728; it has been noted by GNATS.

From: Ulrich Spoerlein <uspoerlein@gmail.com>
To: bug-followup@FreeBSD.org, ino-news@spotteswoode.dnsalias.org
Cc:  
Subject: Re: ports/127728: ports/games/freebsd-games doesn't build, and
 larn(6) segfaults!
Date: Tue, 21 Jul 2009 19:48:59 +0200

 --CE+1k2dSO48ffgeK
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi Clemens,
 
 please try the attached patch for the freebsd-games port and see if it
 fixes the most pressing larn segfaults on 8.0-CURRENT.
 
 It still segfaults on exit for me, but fixing this with patches upon
 patches is not the right way.
 
 As for atc, I cannot reproduce this here. Is this still a valid problem?
 
 Cheers,
 Uli
 
 --CE+1k2dSO48ffgeK
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="larn.diff"
 
 diff -r f2064db6b76c larn/Makefile
 --- a/larn/Makefile	Tue Jul 21 17:26:23 2009 +0200
 +++ b/larn/Makefile	Tue Jul 21 19:07:29 2009 +0200
 @@ -54,7 +54,7 @@
  
  PROG=	larn
  MAN=	larn.6
 -CFLAGS+=-DPOSIX -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE -DNOVARARGS
 +CFLAGS+=-DPOSIX -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE
  SRCS=	main.c object.c create.c tok.c display.c global.c data.c io.c \
  	monster.c store.c diag.c help.c config.c nap.c bill.c scores.c \
  	signal.c moreobj.c movem.c regen.c fortune.c savelev.c
 diff -r f2064db6b76c larn/data.c
 --- a/larn/data.c	Tue Jul 21 17:26:23 2009 +0200
 +++ b/larn/data.c	Tue Jul 21 19:07:29 2009 +0200
 @@ -299,7 +299,7 @@
  
  /*	name array for scrolls		*/
  
 -char *scrollname[] = {
 +char *scrollname[32] = {
  "\0enchant armor",
  "\0enchant weapon",
  "\0enlightenment",
 @@ -327,11 +327,15 @@
  "\0 ",
  "\0 ",
  "\0 ",
 +"\0 ",
 +"\0 ",
 +"\0 ",
 +"\0 ",
  "\0 "
   };
  
  /*	name array for magic potions	*/
 -char *potionname[] = {
 +char *potionname[32] = {
  "\0sleep",
  "\0healing",
  "\0raise level",
 @@ -363,9 +367,6 @@
  "\0 ",
  "\0 ",
  "\0 ",
 -"\0 ",
 -"\0 ",
 -"\0 ",
  "\0 "
   };
  
 diff -r f2064db6b76c larn/global.c
 --- a/larn/global.c	Tue Jul 21 17:26:23 2009 +0200
 +++ b/larn/global.c	Tue Jul 21 19:07:29 2009 +0200
 @@ -27,7 +27,7 @@
  extern char lastmonst[],*what[],*who[];
  extern char winner[];
  extern char logname[],monstlevel[];
 -extern char sciv[SCORESIZE+1][26][2],*potionname[],*scrollname[];
 +extern char sciv[SCORESIZE+1][26][2],*potionname[][32],*scrollname[][32];
  /*
  	***********
  	RAISE LEVEL
 diff -r f2064db6b76c larn/header.h
 --- a/larn/header.h	Tue Jul 21 17:26:23 2009 +0200
 +++ b/larn/header.h	Tue Jul 21 19:07:29 2009 +0200
 @@ -341,9 +341,9 @@
  extern char *lpnt,moved[MAXX][MAXY],mitem[MAXX][MAXY],monstlevel[];
  extern char monstnamelist[],nch[],ndgg[],nlpts[],nomove,nosignal,nowelcome;
  extern char nplt[],nsw[],*objectname[];
 -extern char objnamelist[],optsfile[],*potionname[],playerids[],potprob[];
 +extern char objnamelist[],optsfile[],*potionname[][32],playerids[],potprob[];
  extern char predostuff,psname[],restorflag,savefilename[],scorefile[],scprob[];
 -extern char screen[MAXX][MAXY],*scrollname[],sex,*spelcode[],*speldescript[];
 +extern char screen[MAXX][MAXY],*scrollname[][32],sex,*spelcode[],*speldescript[];
  extern char spelknow[],*spelname[],*spelmes[],spelweird[MAXMONST+8][SPNUM];
  extern char splev[],stealth[MAXX][MAXY],to_lower[],to_upper[],wizard;
  extern short diroffx[],diroffy[],hitflag,hit2flag,hit3flag,hitp[MAXX][MAXY];
 diff -r f2064db6b76c larn/io.c
 --- a/larn/io.c	Tue Jul 21 17:26:23 2009 +0200
 +++ b/larn/io.c	Tue Jul 21 19:07:29 2009 +0200
 @@ -92,7 +92,7 @@
  #endif /* not SYSV */
  
  #ifndef NOVARARGS	/* if we have varargs */
 -#include <varargs.h>
 +#include <stdarg.h>
  #else /* NOVARARGS *//* if we don't have varargs */
  typedef char *va_list;
  #define va_dcl int va_alist;
 @@ -205,17 +205,14 @@
  	}
  #else /* lint */
  /*VARARGS*/
 -lprintf(va_alist)
 -va_dcl
 +lprintf(const char *fmt, ...)
      {
  	va_list ap;	/* pointer for variable argument list */
 -	char *fmt;
  	char *outb,*tmpb;
  	long wide,left,cont,n;		/* data for lprintf	*/
  	char db[12];			/* %d buffer in lprintf	*/
  
 -	va_start(ap);	/* initialize the var args pointer */
 -	fmt = va_arg(ap, char *);	/* pointer to format string */
 +	va_start(ap, fmt);	/* initialize the var args pointer */
  	if (lpnt >= lpend) lflush();
  	outb = lpnt;
  	for ( ; ; )
 
 --CE+1k2dSO48ffgeK--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907211750.n6LHo7el075989>