View | Details | Raw Unified | Return to bug 113773
Collapse All | Expand All

(-)games/xmille/files/patch-Imakefile (+64 lines)
Line 0 Link Here
1
--- Imakefile.orig	Thu Apr  2 23:03:24 1992
2
+++ Imakefile	Thu Dec  4 21:52:59 2003
3
@@ -1,11 +1,11 @@
4
-/**/#
5
-/**/#
6
-/**/# Imakefile for xmille (Mille Bourne game)
7
-/**/#
8
-/**/# Dana Chee
9
-/**/#
10
+XCOMM #
11
+XCOMM #
12
+XCOMM # Imakefile for xmille (Mille Bourne game)
13
+XCOMM #
14
+XCOMM # Dana Chee
15
+XCOMM #
16
 #define IHaveSubdirs
17
-#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS) DEFINES=$(DEFINES)'
18
+#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS) $(DEFINES)'
19
 
20
 HEADERS = ui.h
21
 SRCS=	comp.c end.c extern.c init.c mille.c misc.c move.c print.c \
22
@@ -18,26 +18,26 @@
23
 SYS_LIBRARIES = -lm
24
 SUBDIRS = control cards
25
 
26
-/**/# 
27
-/**/# This looks better with the timrom12 and timrom12b fonts supplied,
28
-/**/# but if you don't wish to install it, just use fixed.
29
-/**/#
30
-/**/# if you do want to use the timrom fonts, then uncomment this line
31
-/**/# and see the info below about font targets
32
-/**/#
33
-/**/#DEFINES =	-DDEFAULT_FONT=\"timrom12\" -DDEFAULT_FONTB=\"timrom12b\"
34
+XCOMM # 
35
+XCOMM # This looks better with the timrom12 and timrom12b fonts supplied,
36
+XCOMM # but if you don't wish to install it, just use fixed.
37
+XCOMM #
38
+XCOMM # if you do want to use the timrom fonts, then uncomment this line
39
+XCOMM # and see the info below about font targets
40
+XCOMM #
41
+XCOMM #DEFINES =	-DDEFAULT_FONT=\"timrom12\" -DDEFAULT_FONTB=\"timrom12b\"
42
 DEFINES =	-DDEFAULT_FONT=\"fixed\" -DDEFAULT_FONTB=\"fixed\"
43
 
44
 MakeSubdirs($(SUBDIRS))
45
 
46
 ComplexProgramTarget(xmille)
47
 
48
-/**/#
49
-/**/# Otherwise, make these font targets (uncomment the following lines)
50
-/**/#
51
-/**/#FONTS = FontBaseObj(timrom12) FontBaseObj(timrom12b)
52
-/**/#FONTINSTDIR = $(FONTDIR)/misc
53
-/**/#FontTarget(timrom12)
54
-/**/#FontTarget(tomrom12b)
55
-/**/#all:: $(FONTS)
56
+XCOMM #
57
+XCOMM # Otherwise, make these font targets (uncomment the following lines)
58
+XCOMM #
59
+XCOMM #FONTS = FontBaseObj(timrom12) FontBaseObj(timrom12b)
60
+XCOMM #FONTINSTDIR = $(FONTDIR)/misc
61
+XCOMM #FontTarget(timrom12)
62
+XCOMM #FontTarget(tomrom12b)
63
+XCOMM #all:: $(FONTS)
64
 
(-)games/xmille/files/patch-ab (-64 lines)
Lines 1-64 Link Here
1
--- Imakefile.orig	Thu Apr  2 23:03:24 1992
2
+++ Imakefile	Thu Dec  4 21:52:59 2003
3
@@ -1,11 +1,11 @@
4
-/**/#
5
-/**/#
6
-/**/# Imakefile for xmille (Mille Bourne game)
7
-/**/#
8
-/**/# Dana Chee
9
-/**/#
10
+XCOMM #
11
+XCOMM #
12
+XCOMM # Imakefile for xmille (Mille Bourne game)
13
+XCOMM #
14
+XCOMM # Dana Chee
15
+XCOMM #
16
 #define IHaveSubdirs
17
-#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS) DEFINES=$(DEFINES)'
18
+#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS) $(DEFINES)'
19
 
20
 HEADERS = ui.h
21
 SRCS=	comp.c end.c extern.c init.c mille.c misc.c move.c print.c \
22
@@ -18,26 +18,26 @@
23
 SYS_LIBRARIES = -lm
24
 SUBDIRS = control cards
25
 
26
-/**/# 
27
-/**/# This looks better with the timrom12 and timrom12b fonts supplied,
28
-/**/# but if you don't wish to install it, just use fixed.
29
-/**/#
30
-/**/# if you do want to use the timrom fonts, then uncomment this line
31
-/**/# and see the info below about font targets
32
-/**/#
33
-/**/#DEFINES =	-DDEFAULT_FONT=\"timrom12\" -DDEFAULT_FONTB=\"timrom12b\"
34
+XCOMM # 
35
+XCOMM # This looks better with the timrom12 and timrom12b fonts supplied,
36
+XCOMM # but if you don't wish to install it, just use fixed.
37
+XCOMM #
38
+XCOMM # if you do want to use the timrom fonts, then uncomment this line
39
+XCOMM # and see the info below about font targets
40
+XCOMM #
41
+XCOMM #DEFINES =	-DDEFAULT_FONT=\"timrom12\" -DDEFAULT_FONTB=\"timrom12b\"
42
 DEFINES =	-DDEFAULT_FONT=\"fixed\" -DDEFAULT_FONTB=\"fixed\"
43
 
44
 MakeSubdirs($(SUBDIRS))
45
 
46
 ComplexProgramTarget(xmille)
47
 
48
-/**/#
49
-/**/# Otherwise, make these font targets (uncomment the following lines)
50
-/**/#
51
-/**/#FONTS = FontBaseObj(timrom12) FontBaseObj(timrom12b)
52
-/**/#FONTINSTDIR = $(FONTDIR)/misc
53
-/**/#FontTarget(timrom12)
54
-/**/#FontTarget(tomrom12b)
55
-/**/#all:: $(FONTS)
56
+XCOMM #
57
+XCOMM # Otherwise, make these font targets (uncomment the following lines)
58
+XCOMM #
59
+XCOMM #FONTS = FontBaseObj(timrom12) FontBaseObj(timrom12b)
60
+XCOMM #FONTINSTDIR = $(FONTDIR)/misc
61
+XCOMM #FontTarget(timrom12)
62
+XCOMM #FontTarget(tomrom12b)
63
+XCOMM #all:: $(FONTS)
64
 
(-)games/xmille/files/patch-ac (-12 lines)
Lines 1-12 Link Here
1
--- save.c.orig	Thu Apr  2 05:56:45 1992
2
+++ save.c	Wed Jan 31 23:04:29 2001
3
@@ -22,7 +22,9 @@
4
  *	This routine saves the current game for use at a later date
5
  */
6
 extern int	errno;
7
+#ifndef __FreeBSD__
8
 extern char	*sys_errlist[];
9
+#endif
10
 
11
 save() {
12
 
(-)games/xmille/files/patch-ad (-17 lines)
Lines 1-17 Link Here
1
--- drawcard.c.orig	Thu Apr  2 05:55:06 1992
2
+++ drawcard.c	Wed Jan 31 23:04:23 2001
3
@@ -183,12 +183,12 @@
4
 				WIDTH, HEIGHT);
5
 		
6
 		XSetForeground(dpy, cheap_gc, bits_p);
7
-		XSetStipple(dpy, cheap_gc, bits);
8
+		XSetStipple(dpy, cheap_gc, mask);
9
 		XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
10
 				WIDTH, HEIGHT);
11
 		
12
 		XSetForeground(dpy, cheap_gc, mask_p);
13
-		XSetStipple(dpy, cheap_gc, mask);
14
+		XSetStipple(dpy, cheap_gc, bits);
15
 		XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
16
 				WIDTH, HEIGHT);
17
 		
(-)games/xmille/files/patch-ae (-11 lines)
Lines 1-11 Link Here
1
--- mille.c.orig	Thu Mar 28 14:29:31 1996
2
+++ mille.c	Thu Feb  1 00:23:54 2001
3
@@ -10,7 +10,7 @@
4
 
5
 int	rub();
6
 
7
-/*char	_sobuf[BUFSIZ];*/
8
+char	_sobuf[BUFSIZ];
9
 
10
 main(ac, av)
11
 reg int		ac;
(-)games/xmille/files/patch-af (-11 lines)
Lines 1-11 Link Here
1
--- move.c.orig	Thu Mar 28 15:13:44 1996
2
+++ move.c	Thu Feb  1 00:33:58 2001
3
@@ -9,8 +9,6 @@
4
 #endif
5
 #define	CTRL(c)		(c - 'A' + 1)
6
 
7
-#define ANIMATE 1
8
-
9
 /*extern FILE *outf;*/
10
 
11
 char	*Movenames[] = {
(-)games/xmille/files/patch-ag (-11 lines)
Lines 1-11 Link Here
1
--- roll.c.orig	Thu Apr  2 23:16:11 1992
2
+++ roll.c	Wed Jan 31 23:04:23 2001
3
@@ -7,7 +7,7 @@
4
 
5
 # define	reg	register
6
 
7
-# if (! defined ultrix && ! defined mips && ! defined vax)
8
+# if (! defined ultrix && ! defined mips && ! defined vax && ! defined __386BSD__ && ! defined __FreeBSD__)
9
 # define	MAXRAND	32767L
10
 
11
 roll(ndie, nsides)
(-)games/xmille/files/patch-ah (-11 lines)
Lines 1-11 Link Here
1
--- varpush.c.orig	Wed Jul  8 11:33:36 1987
2
+++ varpush.c	Thu Feb  1 00:27:53 2001
3
@@ -36,7 +36,7 @@
4
 			char	buf[80];
5
 over:
6
 			printf("Debug file:");
7
-			gets(buf);
8
+			fgets(buf, sizeof(buf), stdin);
9
 			if ((outf = fopen(buf, "w")) == NULL) {
10
 				perror(buf);
11
 				goto over;
(-)games/xmille/files/patch-animate.c (+13 lines)
Line 0 Link Here
1
--- animate.c.orig	Thu Mar 28 15:16:53 1996
2
+++ animate.c	Fri Jun 15 02:11:35 2007
3
@@ -9,6 +9,10 @@
4
 
5
 extern int	iscolor;
6
 
7
+static do_animate();
8
+static draw_square();
9
+static compute_position();
10
+
11
 animate_move (player, orig_type, orig_arg, dest_type, dest_arg)
12
 {
13
 #if 1
(-)games/xmille/files/patch-control__affirm.c (+20 lines)
Line 0 Link Here
1
--- control/affirm.c.orig	Tue Jul 12 02:55:50 1988
2
+++ control/affirm.c	Fri Jun 15 02:05:02 2007
3
@@ -9,6 +9,7 @@
4
 # include	"co_class.h"
5
 # include	<sys/time.h>
6
 # include	<assert.h>
7
+# include	<string.h>
8
 
9
 /*
10
  *	affirm window on screen
11
@@ -33,6 +34,9 @@
12
 static Window	affirm, ok, cancel;
13
 extern	GC	co_fore_gc;
14
 static int	OKstate, CANCELstate;
15
+
16
+static int redisplayLabel();
17
+
18
 
19
 int
20
 co_affirm(title, parent)
(-)games/xmille/files/patch-control__button.c (+32 lines)
Line 0 Link Here
1
--- control/button.c.orig	Thu Apr  2 23:06:52 1992
2
+++ control/button.c	Fri Jun 15 02:05:02 2007
3
@@ -5,6 +5,8 @@
4
 # include	<X11/Xlib.h>
5
 # include	<X11/Xutil.h>
6
 # include	"control.h"
7
+# include	<string.h>
8
+# include	<stdlib.h>
9
 
10
 extern	Display	*dpy;
11
 
12
@@ -31,6 +33,12 @@
13
 static XContext	perwindowContext;
14
 static int		nextButton;
15
 
16
+static int buttonOn();
17
+static int buttonOff();
18
+static int buttonText();
19
+
20
+
21
+
22
 Button
23
 CcreateButton (text, width, gc, font, backcolor, borderwidth)
24
 char		*text;
25
@@ -40,7 +48,6 @@
26
 long		backcolor;
27
 int		borderwidth;
28
 {
29
-	char		*malloc ();
30
 	struct button	*b;
31
 	int		round, off;
32
 	int		hround;
(-)games/xmille/files/patch-control__dispatch.c (+33 lines)
Line 0 Link Here
1
--- control/dispatch.c.orig	Tue Jul 12 02:11:32 1988
2
+++ control/dispatch.c	Fri Jun 15 02:05:02 2007
3
@@ -5,6 +5,7 @@
4
  */
5
 
6
 # include	<X11/Xlib.h>
7
+# include	<stdlib.h>
8
 
9
 struct eventGroup {
10
 	struct eventGroup	*prev;
11
@@ -54,9 +55,12 @@
12
 };
13
 
14
 
15
-struct eventGroup	*eventStack, *allocGroup();
16
+struct eventGroup	*eventStack;
17
 extern	Display		*dpy;
18
 
19
+static struct eventGroup* allocGroup();
20
+
21
+
22
 bindEvent (window, eventMask, func)
23
 Window		window;
24
 unsigned long	eventMask;
25
@@ -135,8 +139,6 @@
26
 static struct eventGroup *
27
 allocGroup ()
28
 {
29
-	char	*malloc ();
30
-
31
 	return (struct eventGroup *) malloc (sizeof (struct eventGroup));
32
 }
33
 
(-)games/xmille/files/patch-control__prompted.c (+49 lines)
Line 0 Link Here
1
--- control/prompted.c.orig	Tue Jul 12 03:01:02 1988
2
+++ control/prompted.c	Fri Jun 15 02:05:02 2007
3
@@ -9,6 +9,7 @@
4
 # include	"co_class.h"
5
 # include	<sys/time.h>
6
 # include	<assert.h>
7
+# include	<string.h>
8
 
9
 /*
10
  *	prompted window on screen
11
@@ -38,6 +39,17 @@
12
 
13
 static int	prompted_done;
14
 
15
+static int co_promptedEvent();
16
+static int co_OKstate();
17
+static int redisplayLabel();
18
+static int textbox_event();
19
+static int handle_char();
20
+static int compute_width();
21
+static int draw_char();
22
+static int draw_string();
23
+static int redisplayText();
24
+
25
+
26
 char *
27
 co_prompted(title, parent)
28
 char *title;
29
@@ -157,7 +169,7 @@
30
 		prompted_done = 1;
31
 		break;
32
 	case '\b':
33
-	case '\0177':
34
+	case 127:
35
 		if (retpointer > returnbuffer) {
36
 			c = *--retpointer;
37
 			*retpointer = '\0';
38
@@ -190,9 +202,10 @@
39
 draw_char (pos, ch, on)
40
 {
41
 	GC	my;
42
+	char    buf = ch;
43
 
44
 	my = on ? co_fore_gc : co_back_gc;
45
-	XDrawImageString (dpy, textbox, my, pos, TEXTBOX_VP, &ch, 1);
46
+	XDrawImageString (dpy, textbox, my, pos, TEXTBOX_VP, &buf, 1);
47
 }
48
 
49
 static
(-)games/xmille/files/patch-drawcard.c (+44 lines)
Line 0 Link Here
1
--- drawcard.c.orig	Thu Apr  2 05:55:06 1992
2
+++ drawcard.c	Fri Jun 15 02:09:15 2007
3
@@ -8,6 +8,8 @@
4
 # include	"ui.h"
5
 # include	"card.h"
6
 # include	"background.h"
7
+# include	<stdlib.h>
8
+
9
 
10
 struct card_init {
11
 	char	*bits;
12
@@ -64,6 +66,9 @@
13
 struct card backside;
14
 struct card eraseCard;
15
 
16
+static drawIm();
17
+static redisplaybelow();
18
+
19
 
20
 bw_init_cards()
21
 {
22
@@ -183,12 +188,12 @@
23
 				WIDTH, HEIGHT);
24
 		
25
 		XSetForeground(dpy, cheap_gc, bits_p);
26
-		XSetStipple(dpy, cheap_gc, bits);
27
+		XSetStipple(dpy, cheap_gc, mask);
28
 		XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
29
 				WIDTH, HEIGHT);
30
 		
31
 		XSetForeground(dpy, cheap_gc, mask_p);
32
-		XSetStipple(dpy, cheap_gc, mask);
33
+		XSetStipple(dpy, cheap_gc, bits);
34
 		XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
35
 				WIDTH, HEIGHT);
36
 		
37
@@ -262,7 +267,6 @@
38
 struct card	*c;
39
 {
40
 	struct displayed	*d, *p;
41
-	char			*malloc ();
42
 
43
 	p = 0;
44
 	for (d = onscreen; d; d = d->next) {
(-)games/xmille/files/patch-extern.c (+11 lines)
Line 0 Link Here
1
--- extern.c.orig	Wed Jul  8 11:32:47 1987
2
+++ extern.c	Fri Jun 15 02:20:34 2007
3
@@ -45,7 +45,7 @@
4
 		1,	/* C_DRIVE_SAFE */
5
 		1,	/* C_RIGHT_WAY */
6
 		0	/* C_INIT */
7
-	};
8
+	},
9
 	Numneed[NUM_CARDS] = {	/* number of cards needed per hand	*/
10
 		0,	/* C_25 */
11
 		0,	/* C_50 */
(-)games/xmille/files/patch-mille.c (+44 lines)
Line 0 Link Here
1
--- mille.c.orig	Thu Mar 28 14:29:31 1996
2
+++ mille.c	Fri Jun 15 02:27:49 2007
3
@@ -1,16 +1,17 @@
4
 # include	"mille.h"
5
 # include	<signal.h>
6
+# include	<stdlib.h>
7
 # ifdef attron
8
 #	include	<term.h>
9
-# endif	attron
10
+# endif	
11
 
12
 /*
13
  * @(#)mille.c	1.3 (Berkeley) 5/10/83
14
  */
15
 
16
-int	rub();
17
+void rub( int );
18
 
19
-/*char	_sobuf[BUFSIZ];*/
20
+char	_sobuf[BUFSIZ];
21
 
22
 main(ac, av)
23
 reg int		ac;
24
@@ -123,9 +124,9 @@
25
  *	Routine to trap rubouts, and make sure they really want to
26
  * quit.
27
  */
28
-rub() {
29
+void rub( int signum ) {
30
 
31
-	signal(SIGINT, 1);
32
+	signal(SIGINT, SIG_IGN);
33
 	if (getyn("Really? "))
34
 		die();
35
 	signal(SIGINT, rub);
36
@@ -136,7 +137,7 @@
37
  */
38
 die() {
39
 
40
-	signal(SIGINT, 1);
41
+	signal(SIGINT, SIG_IGN);
42
 	if (outf)
43
 		fflush(outf);
44
 	finish_ui ();
(-)games/xmille/files/patch-misc.c (+11 lines)
Line 0 Link Here
1
--- misc.c.orig	Wed Jul  8 11:33:04 1987
2
+++ misc.c	Fri Jun 15 02:20:34 2007
3
@@ -2,7 +2,7 @@
4
 # ifdef	attron
5
 #	include	<term.h>
6
 #	define	_tty	cur_term->Nttyb
7
-# endif	attron
8
+# endif	
9
 
10
 /*
11
  * @(#)misc.c	1.3 (Berkeley) 7/2/83
(-)games/xmille/files/patch-move.c (+72 lines)
Line 0 Link Here
1
--- move.c.orig	Thu Mar 28 15:13:44 1996
2
+++ move.c	Fri Jun 15 02:33:02 2007
3
@@ -9,15 +9,16 @@
4
 #endif
5
 #define	CTRL(c)		(c - 'A' + 1)
6
 
7
-#define ANIMATE 1
8
-
9
 /*extern FILE *outf;*/
10
 
11
 char	*Movenames[] = {
12
 		"M_DISCARD", "M_DRAW", "M_PLAY", "M_ORDER"
13
 	};
14
 
15
-char	*playcard (), *sprint ();
16
+char	*playcard (), 
17
+        *sprintDecimal( char* format, int arg ),
18
+        *sprintString( char* format, char* arg );
19
+
20
 
21
 domove()
22
 {
23
@@ -203,7 +204,7 @@
24
 			return ("limit of 50");
25
 	  case C_50:
26
 		if (pp->mileage + Value[card] > End)
27
-			return sprint ("puts you over %d", End);
28
+			return sprintDecimal ("puts you over %d", End);
29
 	  case C_25:
30
 		if (!pp->can_go)
31
 			return ("cannot move now");
32
@@ -220,7 +221,7 @@
33
 
34
 	  case C_GAS:	case C_SPARE:	case C_REPAIRS:
35
 		if (pp->battle != opposite(card))
36
-			return sprint ("can't play \"%s\"", C_name[card]);
37
+			return sprintString ("can't play \"%s\"", C_name[card]);
38
 #ifdef ANIMATE
39
 		animate_move (Play, ANIMATE_HAND, Card_no, ANIMATE_BATTLE, card);
40
 #endif
41
@@ -232,7 +233,7 @@
42
 	  case C_GO:
43
 		if (pp->battle != C_INIT && pp->battle != C_STOP
44
 		    && !isrepair(pp->battle))
45
-			return sprint ("cannot play \"Go\"on a \"%s\"",
46
+			return sprintString ("cannot play \"Go\"on a \"%s\"",
47
 			    C_name[pp->battle]);
48
 #ifdef ANIMATE
49
 		animate_move (Play, ANIMATE_HAND, Card_no, ANIMATE_BATTLE, card);
50
@@ -339,12 +340,19 @@
51
 	return 0;
52
 }
53
 
54
-char *
55
-sprint (string, arg)
56
+char* sprintDecimal( char* format, int arg )
57
+{
58
+	static char	buf[512];
59
+
60
+	sprintf (buf, format, arg);
61
+	return buf;
62
+}
63
+
64
+char* sprintString( char* format, char* arg )
65
 {
66
 	static char	buf[512];
67
 
68
-	sprintf (buf, string, arg);
69
+	sprintf (buf, format, arg);
70
 	return buf;
71
 }
72
 
(-)games/xmille/files/patch-roll.c (+11 lines)
Line 0 Link Here
1
--- roll.c.orig	Thu Apr  2 23:16:11 1992
2
+++ roll.c	Wed Jan 31 23:04:23 2001
3
@@ -7,7 +7,7 @@
4
 
5
 # define	reg	register
6
 
7
-# if (! defined ultrix && ! defined mips && ! defined vax)
8
+# if (! defined ultrix && ! defined mips && ! defined vax && ! defined __386BSD__ && ! defined __FreeBSD__)
9
 # define	MAXRAND	32767L
10
 
11
 roll(ndie, nsides)
(-)games/xmille/files/patch-save.c (+82 lines)
Line 0 Link Here
1
--- save.c.orig	Thu Apr  2 05:56:45 1992
2
+++ save.c	Fri Jun 15 02:20:34 2007
3
@@ -1,43 +1,46 @@
4
 #include	"mille.h"
5
 #include	<sys/types.h>
6
 #include	<sys/stat.h>
7
-#include	<sys/time.h>
8
+#include	<time.h>
9
+#include	<errno.h>
10
+#include	<string.h>
11
+#include	<stdlib.h>
12
 # ifdef	attron
13
 #	include	<term.h>
14
 #	define	_tty	cur_term->Nttyb
15
-# endif	attron
16
+# endif	
17
 
18
 /*
19
  * @(#)save.c	1.4 (Berkeley) 7/3/83
20
  */
21
 
22
 typedef	struct stat	Stat;
23
-typedef	struct tm	Time;
24
 
25
 char	*ctime();
26
 
27
 int	read(), write();
28
+char*   GetpromptedInput( char* );
29
 
30
 /*
31
  *	This routine saves the current game for use at a later date
32
  */
33
 extern int	errno;
34
-extern char	*sys_errlist[];
35
+/* extern char	*sys_errlist[]; */
36
 
37
 save() {
38
 
39
 	reg char	*sp;
40
 	reg int		outf;
41
-	reg Time	*tp;
42
+	reg time_t	*tp;
43
 	char		buf[80];
44
-	Time		tme;
45
+	time_t		tme;
46
 	Stat		junk;
47
 
48
 	tp = &tme;
49
 	if (Fromfile && getyn("Same file? "))
50
-		strcpy(buf, Fromfile);
51
+	        strncpy(buf, Fromfile,sizeof(buf));
52
 	else {
53
-		strcpy (buf, GetpromptedInput ("file: "));
54
+	        strncpy (buf, GetpromptedInput ("file: "), sizeof(buf));
55
 		sp = buf + strlen (buf);
56
 	}
57
 
58
@@ -50,12 +53,13 @@
59
 		return FALSE;
60
 
61
 	if ((outf = creat(buf, 0644)) < 0) {
62
-		error(sys_errlist[errno]);
63
+		/* error(sys_errlist[errno]); */
64
+		strerror(errno);
65
 		return FALSE;
66
 	}
67
 	Error (buf);
68
 	time(tp);			/* get current time		*/
69
-	strcpy(buf, ctime(tp));
70
+	strncpy(buf, ctime(tp), sizeof(buf));
71
 	for (sp = buf; *sp != '\n'; sp++)
72
 		continue;
73
 	*sp = '\0';
74
@@ -87,7 +91,7 @@
75
 	}
76
 	varpush(inf, read);
77
 	close(inf);
78
-	strcpy(buf, ctime(&sbuf.st_mtime));
79
+	strncpy(buf, ctime(&sbuf.st_mtime),sizeof(buf));
80
 	for (sp = buf; *sp != '\n'; sp++)
81
 		continue;
82
 	*sp = '\0';
(-)games/xmille/files/patch-ui.c (+33 lines)
Line 0 Link Here
1
--- ui.c.orig	Tue Apr  2 12:55:55 1996
2
+++ ui.c	Fri Jun 15 02:20:34 2007
3
@@ -7,6 +7,8 @@
4
 # include	"mille.h"
5
 # include	"ui.h"
6
 # include	<X11/Xutil.h>
7
+# include	<string.h>
8
+# include	<stdlib.h>
9
 
10
 #ifdef CTRL
11
 # undef CTRL
12
@@ -84,7 +86,9 @@
13
 		return(orig);
14
 	if (XTextWidth (font, orig, len) < max)
15
 		return orig;
16
-	strcpy (buf, orig);
17
+	if (len > sizeof(buf))
18
+	    len = sizeof(buf);
19
+	strncpy (buf, orig, len);
20
 	do {
21
 		buf[--len] = '\0';
22
 	} while (len > 0 && XTextWidth (font, buf, len) >= max);
23
@@ -409,6 +413,10 @@
24
 	Colormap	def_cm;
25
 
26
 	dpy = XOpenDisplay ((char *) 0);
27
+	if (!dpy) {
28
+		printf("Error: Can't open X Display\n");
29
+		exit(1);
30
+	}
31
 	screen = DefaultScreen(dpy);
32
 	def_cm = DefaultColormap(dpy, screen);
33
 	
(-)games/xmille/files/patch-varpush.c (+32 lines)
Line 0 Link Here
1
--- varpush.c.orig	Wed Jul  8 11:33:36 1987
2
+++ varpush.c	Fri Jun 15 02:20:34 2007
3
@@ -1,3 +1,5 @@
4
+#include	<stdio.h>
5
+#include	<string.h>
6
 # include	"mille.h"
7
 
8
 /*
9
@@ -6,6 +8,13 @@
10
 
11
 int	read(), write();
12
 
13
+static void remove_terminating_newline( char* buf )
14
+{
15
+    int len = strlen(buf);
16
+    if ( buf[len-1] == '\n' )
17
+	buf[len-1] = 0;
18
+}
19
+
20
 /*
21
  *	push variables around via the routine func() on the file
22
  * channel file.  func() is either read or write.
23
@@ -36,7 +45,8 @@
24
 			char	buf[80];
25
 over:
26
 			printf("Debug file:");
27
-			gets(buf);
28
+			fgets(buf,80,stdin);
29
+			remove_terminating_newline(buf);
30
 			if ((outf = fopen(buf, "w")) == NULL) {
31
 				perror(buf);
32
 				goto over;

Return to bug 113773