View | Details | Raw Unified | Return to bug 176997 | Differences between
and this patch

Collapse All | Expand All

(-)./Makefile (-9 / +21 lines)
Lines 1-27 Link Here
1
# New ports collection makefile for:	Maelstrom
1
# Created by: Andrey Zakhvatov
2
# Date created:				13 May 1998
3
# Whom:					Andrey Zakhvatov
4
#
5
# $FreeBSD: head/games/maelstrom/Makefile 300896 2012-07-14 13:54:48Z beat $
2
# $FreeBSD: head/games/maelstrom/Makefile 300896 2012-07-14 13:54:48Z beat $
6
#
7
3
8
PORTNAME=	maelstrom
4
PORTNAME=	maelstrom
9
PORTVERSION=	3.0.6
5
PORTVERSION=	3.0.6
10
PORTREVISION=	8
6
PORTREVISION=	9
11
CATEGORIES=	games
7
CATEGORIES=	games
12
MASTER_SITES=	http://slouken.libsdl.org/projects/Maelstrom/src/
8
MASTER_SITES=	http://slouken.libsdl.org/projects/Maelstrom/src/ \
9
		SF/nemysisfreebsdp/:icons
13
DISTNAME=	Maelstrom-${PORTVERSION}
10
DISTNAME=	Maelstrom-${PORTVERSION}
11
DISTFILES=	Maelstrom-${DISTVERSION}${EXTRACT_SUFX} \
12
		${PORTNAME}.png:icons
14
DIST_SUBDIR=	${PORTNAME}
13
DIST_SUBDIR=	${PORTNAME}
14
EXTRACT_ONLY=	Maelstrom-${DISTVERSION}${EXTRACT_SUFX}
15
15
16
MAINTAINER=	ports@FreeBSD.org
16
MAINTAINER=	nemysis@gmx.ch
17
COMMENT=	Asteroids-style game for X Window System
17
COMMENT=	Asteroids-style game for X Window System
18
18
19
LICENSE=	GPLv2
20
19
USE_SDL=	sdl net
21
USE_SDL=	sdl net
20
USE_XORG=	xpm
22
USE_XORG=	xpm
21
GNU_CONFIGURE=	yes
23
GNU_CONFIGURE=	yes
22
MAKE_JOBS_SAFE=	yes
24
MAKE_JOBS_SAFE=	yes
23
25
24
.if !defined(NOPORTDOCS)
26
DATADIR=	${PREFIX}/share/Maelstrom
27
DOCSDIR=	${PREFIX}/share/doc/Maelstrom
28
PORTDOCS=	*
29
30
DESKTOP_ENTRIES="Maelstrom" "${COMMENT}" ${PORTNAME} \
31
		"Maelstrom" "Game;ArcadeGame;" false
32
33
.include <bsd.port.options.mk>
34
35
.if ${PORT_OPTIONS:MDOCS}
25
INSTALL_TARGET=	install install_gamedocs
36
INSTALL_TARGET=	install install_gamedocs
26
.endif
37
.endif
27
38
Lines 30-34 Link Here
30
	${CHMOD} 2755 ${PREFIX}/bin/Maelstrom
41
	${CHMOD} 2755 ${PREFIX}/bin/Maelstrom
31
	${CHMOD} 664 ${PREFIX}/share/Maelstrom/Maelstrom-Scores
42
	${CHMOD} 664 ${PREFIX}/share/Maelstrom/Maelstrom-Scores
32
	${CHOWN} root:games ${PREFIX}/share/Maelstrom/Maelstrom-Scores
43
	${CHOWN} root:games ${PREFIX}/share/Maelstrom/Maelstrom-Scores
44
	${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png ${PREFIX}/share/pixmaps/
33
45
34
.include <bsd.port.mk>
46
.include <bsd.port.mk>
(-)./distinfo (+2 lines)
Lines 1-2 Link Here
1
SHA256 (maelstrom/Maelstrom-3.0.6.tar.gz) = e7983c2c7376cdcca1944db1706d92aedd529638cf13358c88a60df982ba7b46
1
SHA256 (maelstrom/Maelstrom-3.0.6.tar.gz) = e7983c2c7376cdcca1944db1706d92aedd529638cf13358c88a60df982ba7b46
2
SIZE (maelstrom/Maelstrom-3.0.6.tar.gz) = 1013073
2
SIZE (maelstrom/Maelstrom-3.0.6.tar.gz) = 1013073
3
SHA256 (maelstrom/maelstrom.png) = 814b1b6f6aacc5faf2befa52df0b97ff89efc8d5bffb3146c0cd6e354fda7799
4
SIZE (maelstrom/maelstrom.png) = 2058
(-)./files/patch-Makefile.in (+13 lines)
Line 0 Link Here
1
--- Makefile.in.orig	2002-10-20 06:19:42.000000000 +0200
2
+++ Makefile.in	2013-03-16 13:24:43.000000000 +0100
3
@@ -444,8 +444,8 @@
4
 	chmod 666 $(target)/Maelstrom-Scores
5
 
6
 install_gamedocs:
7
-	sh mkinstalldirs $(target)/
8
-	cp -rv README* COPYING* Docs*	$(target)/
9
+	sh mkinstalldirs $(prefix)/share/doc/Maelstrom/
10
+	cp -rv README* COPYING* Docs/* $(prefix)/share/doc/Maelstrom/
11
 
12
 # Rule to build tar-gzipped distribution package
13
 $(PACKAGE)-$(VERSION).tar.gz: dist
(-)./files/patch-ab (-12 lines)
Lines 1-12 Link Here
1
--- configure.orig	Mon Mar 13 20:58:01 2000
2
+++ configure	Mon Mar 13 20:58:05 2000
3
@@ -1633,6 +1633,9 @@
4
         ac_default_prefix=/boot/beos
5
         GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
6
         ;;
7
+    *-*-freebsd*)
8
+	GAME_INSTALLDIR="\$(prefix)/share/$PACKAGE"
9
+	;;
10
     *)
11
         GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
12
         ;;
(-)./files/patch-ac (-13 lines)
Lines 1-13 Link Here
1
--- Makefile.in.orig	Mon Mar 13 21:21:22 2000
2
+++ Makefile.in	Mon Mar 13 21:34:53 2000
3
@@ -446,8 +446,8 @@
4
 	chmod 666 $(target)/Maelstrom-Scores
5
 
6
 install_gamedocs:
7
-	sh mkinstalldirs $(target)/
8
-	cp -rv README* COPYING* Docs*	$(target)/
9
+	sh mkinstalldirs $(prefix)/share/doc/Maelstrom/
10
+	cp -rv README* COPYING* Docs/*	$(prefix)/share/doc/Maelstrom/
11
 
12
 # Rule to build tar-gzipped distribution package
13
 $(PACKAGE)-$(VERSION).tar.gz: dist
(-)./files/patch-ad (-381 lines)
Lines 1-381 Link Here
1
diff -ur Maelstrom-3.0.6-orig/controls.cpp Maelstrom-3.0.6/controls.cpp
2
--- controls.cpp	2001-03-25 03:04:28 +0900
3
+++ controls.cpp	2003-05-21 11:25:53 +0900
4
@@ -83,7 +83,7 @@
5
 	if ( fname ) {
6
 		*fname = datafile;
7
 	}
8
-	sprintf(datafile,  "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
9
+	snprintf(datafile, sizeof(datafile), "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
10
 	if ( (data=fopen(datafile, mode)) == NULL )
11
 		return(NULL);
12
 	return(data);
13
diff -ur Maelstrom-3.0.6-orig/dialog.h Maelstrom-3.0.6/dialog.h
14
--- dialog.h	2001-07-21 00:08:10 +0900
15
+++ dialog.h	2003-05-21 11:24:33 +0900
16
@@ -92,7 +92,7 @@
17
 		va_list ap;
18
 
19
 		va_start(ap, fmt);
20
-		vsprintf(errbuf, fmt, ap);
21
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
22
 		va_end(ap);
23
 		errstr = errbuf;
24
         }
25
@@ -878,7 +878,7 @@
26
 		if ( entry->text ) {
27
 			Fontserv->FreeText(entry->text);
28
 		}
29
-		sprintf(buf, "%d", *entry->variable);
30
+		snprintf(buf, sizeof(buf), "%d", *entry->variable);
31
 
32
 		if ( entry->hilite ) {
33
 			clear = Fg;
34
diff -ur Maelstrom-3.0.6-orig/load.cpp Maelstrom-3.0.6/load.cpp
35
--- load.cpp	2000-02-15 11:47:39 +0900
36
+++ load.cpp	2003-05-21 11:26:18 +0900
37
@@ -81,7 +81,7 @@
38
 	SDL_Surface *bmp, *title;
39
 	
40
 	/* Open the title file -- we know its colormap is our global one */
41
-	sprintf(file, "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
42
+	snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
43
 	bmp = SDL_LoadBMP(path.Path(file));
44
 	if ( bmp == NULL ) {
45
 		return(NULL);
46
@@ -103,7 +103,7 @@
47
 	Uint16 w, h;
48
 	
49
 	/* Open the cicn sprite file.. */
50
-	sprintf(file, "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
51
+	snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
52
 	if ( (cicn_src=SDL_RWFromFile(path.Path(file), "r")) == NULL ) {
53
 		error("GetCIcon(%hd): Can't open CICN %s: ",
54
 					cicn_id, path.Path(file));
55
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_FontServ.h Maelstrom-3.0.6/maclib/Mac_FontServ.h
56
--- maclib/Mac_FontServ.h	1999-12-03 02:15:33 +0900
57
+++ maclib/Mac_FontServ.h	2003-05-21 11:28:43 +0900
58
@@ -135,7 +135,7 @@
59
 		va_list ap;
60
 
61
 		va_start(ap, fmt);
62
-		vsprintf(errbuf, fmt, ap);
63
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
64
 		va_end(ap);
65
 		errstr = errbuf;
66
 	}
67
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_Resource.h Maelstrom-3.0.6/maclib/Mac_Resource.h
68
--- maclib/Mac_Resource.h	1999-12-04 03:01:47 +0900
69
+++ maclib/Mac_Resource.h	2003-05-21 11:28:35 +0900
70
@@ -96,7 +96,7 @@
71
 		va_list ap;
72
 
73
 		va_start(ap, fmt);
74
-		vsprintf(errbuf, fmt, ap);
75
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
76
 		va_end(ap);
77
 		errstr = errbuf;
78
 	}
79
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_Sound.h Maelstrom-3.0.6/maclib/Mac_Sound.h
80
--- maclib/Mac_Sound.h	2002-10-20 11:53:34 +0900
81
+++ maclib/Mac_Sound.h	2003-05-21 11:28:27 +0900
82
@@ -199,7 +199,7 @@
83
 		va_list ap;
84
 
85
 		va_start(ap, fmt);
86
-		vsprintf(errbuf, fmt, ap);
87
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
88
 		va_end(ap);
89
 		errstr = errbuf;
90
 	}
91
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_Wave.h Maelstrom-3.0.6/maclib/Mac_Wave.h
92
--- maclib/Mac_Wave.h	2000-01-26 01:44:10 +0900
93
+++ maclib/Mac_Wave.h	2003-05-21 11:28:20 +0900
94
@@ -108,7 +108,7 @@
95
 		va_list ap;
96
 
97
 		va_start(ap, fmt);
98
-		vsprintf(errbuf, fmt, ap);
99
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
100
 		va_end(ap);
101
 		errstr = errbuf;
102
 	}
103
diff -ur Maelstrom-3.0.6-orig/maclib/macres.cpp Maelstrom-3.0.6/maclib/macres.cpp
104
--- maclib/macres.cpp	2000-01-26 01:44:20 +0900
105
+++ maclib/macres.cpp	2003-05-21 11:30:01 +0900
106
@@ -58,8 +58,8 @@
107
 				ids[j], res->ResourceName(types[i], ids[j]));
108
 			if ( argv[2] ) {
109
 				char path[23];
110
-				sprintf(path,"%s/%s:%hu", argv[2],
111
-							types[i], ids[j]);
112
+				snprintf(path, sizeof(path), "%s/%s:%hu",
113
+					 argv[2], types[i], ids[j]);
114
 				FILE *output;
115
 				Mac_ResData *D;
116
             			if ( (output=fopen(path, "w")) != NULL ) {
117
diff -ur Maelstrom-3.0.6-orig/maclib/snd2wav.cpp Maelstrom-3.0.6/maclib/snd2wav.cpp
118
--- maclib/snd2wav.cpp	2001-03-28 12:54:50 +0900
119
+++ maclib/snd2wav.cpp	2003-05-21 11:29:23 +0900
120
@@ -82,7 +82,7 @@
121
 			continue;
122
 		}
123
 		wave.Load(snd, rate);
124
-		sprintf(wavname, "snd_%d.wav", ids[i]);
125
+		snprintf(wavname, sizeof(wavname), "snd_%d.wav", ids[i]);
126
 		wave.Save(wavname);
127
 	}
128
 	delete macx;
129
diff -ur Maelstrom-3.0.6-orig/main.cpp Maelstrom-3.0.6/main.cpp
130
--- main.cpp	2002-10-20 11:53:32 +0900
131
+++ main.cpp	2003-05-21 11:27:02 +0900
132
@@ -445,7 +445,7 @@
133
 		DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
134
 							0x00, 0x00, 0x00);
135
 	}
136
-	sprintf(text, "%d", gSoundLevel);
137
+	snprintf(text, sizeof(text), "%d", gSoundLevel);
138
 	DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
139
 						30000>>8, 30000>>8, 0xFF);
140
 	screen->Update();
141
@@ -547,11 +547,11 @@
142
 		}
143
 		DrawText(xOff+5, botDiv+42+(index*18), hScores[index].name,
144
 						font, STYLE_BOLD, R, G, B);
145
-		sprintf(buffer, "%u", hScores[index].score);
146
+		snprintf(buffer, sizeof(buffer), "%u", hScores[index].score);
147
 		sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
148
 		DrawText(sRt-sw, botDiv+42+(index*18), buffer, 
149
 						font, STYLE_BOLD, R, G, B);
150
-		sprintf(buffer, "%u", hScores[index].wave);
151
+		snprintf(buffer, sizeof(buffer), "%u", hScores[index].wave);
152
 		sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
153
 		DrawText(wRt-sw, botDiv+42+(index*18), buffer, 
154
 						font, STYLE_BOLD, R, G, B);
155
@@ -560,7 +560,7 @@
156
 
157
 	DrawText(xOff+5, botDiv+46+(10*18)+3, "Last Score: ", 
158
 					bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
159
-	sprintf(buffer, "%d", GetScore());
160
+	snprintf(buffer, sizeof(buffer), "%d", GetScore());
161
 	sw = fontserv->TextWidth("Last Score: ", bigfont, STYLE_NORM);
162
 	DrawText(xOff+5+sw, botDiv+46+(index*18)+3, buffer, 
163
 					bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
164
diff -ur Maelstrom-3.0.6-orig/myerror.cpp Maelstrom-3.0.6/myerror.cpp
165
--- myerror.cpp	1998-07-14 10:50:17 +0900
166
+++ myerror.cpp	2003-05-21 11:23:33 +0900
167
@@ -16,7 +16,7 @@
168
 	va_list ap;
169
 
170
 	va_start(ap, fmt);
171
-	vsprintf(mesg, fmt, ap);
172
+	vsnprintf(mesg, sizeof(mesg), fmt, ap);
173
 	fputs(mesg, stderr);
174
 	va_end(ap);
175
 }
176
@@ -27,7 +27,7 @@
177
 	va_list ap;
178
 
179
 	va_start(ap, fmt);
180
-	vsprintf(mesg, fmt, ap);
181
+	vsnprintf(mesg, sizeof(mesg), fmt, ap);
182
 	fputs(mesg, stdout);
183
 	va_end(ap);
184
 }
185
@@ -37,7 +37,7 @@
186
 	char buffer[BUFSIZ];
187
 
188
 	if ( *msg ) {
189
-		sprintf(buffer, "%s: %s\n", msg, strerror(errno));
190
+		snprintf(buffer, sizeof(buffer), "%s: %s\n", msg, strerror(errno));
191
 		error(buffer);
192
 	} else
193
 		error((char *)strerror(errno));
194
diff -ur Maelstrom-3.0.6-orig/netlogic/game.cpp Maelstrom-3.0.6/netlogic/game.cpp
195
--- netlogic/game.cpp	2001-07-23 11:24:03 +0900
196
+++ netlogic/game.cpp	2003-05-21 11:33:19 +0900
197
@@ -232,7 +232,7 @@
198
 
199
 			lastDisplayed = gDisplayed;
200
 			screen->FillRect(0, 0, SCREEN_WIDTH, 12, ourBlack);
201
-			sprintf(caption,
202
+			snprintf(caption, sizeof(caption),
203
 				"You are player %d --- displaying player %d",
204
 						gOurPlayer+1, gDisplayed+1);
205
 			DrawText(SPRITES_WIDTH, 11, caption, geneva,
206
@@ -357,7 +357,7 @@
207
 				/* -- Erase old and draw new score */
208
 				screen->FillRect(45, gStatusLine+1,
209
 					score_width, text_height, ourBlack);
210
-				sprintf(numbuf, "%d", Score);
211
+				snprintf(numbuf, sizeof(numbuf), "%d", Score);
212
 				score_width = DrawText(45, gStatusLine+11, 
213
 						numbuf, geneva, STYLE_BOLD,
214
 							0xFF, 0xFF, 0xFF);
215
@@ -380,7 +380,7 @@
216
 		if (lastWave != gWave) {
217
 			screen->FillRect(255, gStatusLine+1,
218
 					wave_width, text_height, ourBlack);
219
-			sprintf(numbuf, "%d", gWave);
220
+			snprintf(numbuf, sizeof(numbuf), "%d", gWave);
221
 			wave_width = DrawText(255, gStatusLine+11, 
222
 					numbuf, geneva, STYLE_BOLD,
223
 							0xFF, 0xFF, 0xFF);
224
@@ -391,7 +391,7 @@
225
 		if (lastLives != Lives) {
226
 			screen->FillRect(319, gStatusLine+1,
227
 					lives_width, text_height, ourBlack);
228
-			sprintf(numbuf, "%-3.1d", Lives);
229
+			snprintf(numbuf, sizeof(numbuf), "%-3.1d", Lives);
230
 			lives_width = DrawText(319, gStatusLine+11,
231
 					numbuf, geneva, STYLE_BOLD,
232
 							0xFF, 0xFF, 0xFF);
233
@@ -402,7 +402,7 @@
234
 		if (lastBonus != Bonus) {
235
 			screen->FillRect(384, gStatusLine+1,
236
 					bonus_width, text_height, ourBlack);
237
-			sprintf(numbuf, "%-7.1d", Bonus);
238
+			snprintf(numbuf, sizeof(numbuf), "%-7.1d", Bonus);
239
 			bonus_width = DrawText(384, gStatusLine+11,
240
 					numbuf, geneva, STYLE_BOLD,
241
 							0xFF, 0xFF, 0xFF);
242
@@ -414,7 +414,7 @@
243
 			if (lastFrags != Frags) {
244
 				screen->FillRect(fragoff, gStatusLine+1,
245
 					frags_width, text_height, ourBlack);
246
-				sprintf(numbuf, "%-3.1d", Frags);
247
+				snprintf(numbuf, sizeof(numbuf), "%-3.1d", Frags);
248
 				frags_width = DrawText(fragoff, gStatusLine+11,
249
 						numbuf, geneva, STYLE_BOLD,
250
 							0xFF, 0xFF, 0xFF);
251
@@ -747,10 +747,11 @@
252
 		for ( i=0; i<gNumPlayers; ++i ) {
253
 			char buffer[BUFSIZ], num1[12], num2[12];
254
 
255
-			sprintf(num1, "%7.1d", final[i].Score);
256
-			sprintf(num2, "%3.1d", final[i].Frags);
257
-			sprintf(buffer, "Player %d: %-.7s Points, %-.3s Frags",
258
-						final[i].Player, num1, num2);
259
+			snprintf(num1, sizeof(num1), "%7.1d", final[i].Score);
260
+			snprintf(num2, sizeof(num2), "%3.1d", final[i].Frags);
261
+			snprintf(buffer, sizeof(buffer),
262
+				 "Player %d: %-.7s Points, %-.3s Frags",
263
+				 final[i].Player, num1, num2);
264
 			DrawText(160, 380+i*newyork_height, buffer,
265
 				newyork, STYLE_NORM, 30000>>8, 30000>>8, 0xFF);
266
 		}
267
@@ -898,7 +899,7 @@
268
 	
269
 
270
 	/* -- Draw the wave completed message */
271
-	sprintf(numbuf, "Wave %d completed.", gWave);
272
+	snprintf(numbuf, sizeof(numbuf), "Wave %d completed.", gWave);
273
 	sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
274
 	x = (SCREEN_WIDTH - sw) / 2;
275
 	DrawText(x,  150, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
276
@@ -935,7 +936,7 @@
277
 		if (OurShip->GetBonusMult() != 1) {
278
 			SDL_Surface *sprite;
279
 
280
-			sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
281
+			snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
282
 			DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
283
 							0xFF, 0xFF, 0xFF);
284
 			x += 75;
285
@@ -951,10 +952,10 @@
286
 	Delay(SOUND_DELAY);
287
 	sound->PlaySound(gFunk, 5);
288
 
289
-	sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
290
+	snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
291
 	bonus_width = DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
292
 							0xFF, 0xFF, 0xFF);
293
-	sprintf(numbuf, "%-5.1d", OurShip->GetScore());
294
+	snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
295
 	score_width = DrawText(xt, 220, numbuf, geneva, STYLE_BOLD,
296
 							0xFF, 0xFF, 0xFF);
297
 	screen->Update();
298
@@ -997,12 +998,12 @@
299
 	
300
 			screen->FillRect(x, 200-text_height+2,
301
 					bonus_width, text_height, ourBlack);
302
-			sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
303
+			snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
304
 			bonus_width = DrawText(x, 200, numbuf,
305
 					geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
306
 			screen->FillRect(xt, 220-text_height+2,
307
 					score_width, text_height, ourBlack);
308
-			sprintf(numbuf, "%-5.1d", OurShip->GetScore());
309
+			snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
310
 			score_width = DrawText(xt, 220, numbuf,
311
 					geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
312
 
313
@@ -1015,7 +1016,7 @@
314
 	HandleEvents(10);
315
 
316
 	/* -- Draw the "next wave" message */
317
-	sprintf(numbuf, "Prepare for Wave %d...", gWave+1);
318
+	snprintf(numbuf, sizeof(numbuf), "Prepare for Wave %d...", gWave+1);
319
 	sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
320
 	x = (SCREEN_WIDTH - sw)/2;
321
 	DrawText(x, 259, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
322
diff -ur Maelstrom-3.0.6-orig/netlogic/netplay.cpp Maelstrom-3.0.6/netlogic/netplay.cpp
323
--- netlogic/netplay.cpp	2002-10-20 13:11:52 +0900
324
+++ netlogic/netplay.cpp	2003-05-21 11:31:43 +0900
325
@@ -670,7 +670,9 @@
326
 		strcpy(message, "Waiting for players:");
327
 		for ( i=0; i<gNumPlayers; ++i ) {
328
 			if ( ! acked[i] )
329
-				sprintf(&message[strlen(message)], " %d", i+1);
330
+				snprintf(&message[strlen(message)],
331
+					 sizeof(message)-strlen(message),
332
+					 " %d", i+1);
333
 		}
334
 		Message(message);
335
 
336
@@ -725,7 +727,7 @@
337
 			/* Check the player... */
338
 			if ( (i != gOurPlayer) && (netbuf[1] == gOurPlayer) ) {
339
 				/* Print message, sleep 3 seconds absolutely */
340
-				sprintf(message, 
341
+			  snprintf(message, sizeof(message),
342
 	"Error: Another player (%d) thinks they are player 1!\r\n", i+1);
343
 				ErrorMessage(message);
344
 				/* Suck up retransmission packets */
345
diff -ur Maelstrom-3.0.6-orig/netscore.cpp Maelstrom-3.0.6/netscore.cpp
346
--- netscore.cpp	2001-07-23 12:25:17 +0900
347
+++ netscore.cpp	2003-05-21 11:27:18 +0900
348
@@ -59,7 +59,7 @@
349
 
350
 	/* Send the scores */
351
 	crc = get_checksum(key, KEY_LEN);
352
-	sprintf(netbuf, SCOREFMT, crc, high.name, high.score, high.wave);
353
+	snprintf(netbuf, sizeof(netbuf), SCOREFMT, crc, high.name, high.score, high.wave);
354
 	SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
355
 	n = SDLNet_TCP_Recv(remote, netbuf, 1024);
356
 	if ( n > 0 ) {
357
diff -ur Maelstrom-3.0.6-orig/screenlib/SDL_FrameBuf.cpp Maelstrom-3.0.6/screenlib/SDL_FrameBuf.cpp
358
--- screenlib/SDL_FrameBuf.cpp	2001-07-23 06:03:13 +0900
359
+++ screenlib/SDL_FrameBuf.cpp	2003-05-21 11:31:01 +0900
360
@@ -628,7 +628,7 @@
361
 
362
 		found = 0;
363
 		for ( which=0; !found; ++which ) {
364
-			sprintf(file, "%s%d.bmp", prefix, which);
365
+			snprintf(file, sizeof(file), "%s%d.bmp", prefix, which);
366
 			if ( ((fp=fopen(file, "r")) == NULL) &&
367
 			     ((fp=fopen(file, "w")) != NULL) ) {
368
 				found = 1;
369
diff -ur Maelstrom-3.0.6-orig/screenlib/SDL_FrameBuf.h Maelstrom-3.0.6/screenlib/SDL_FrameBuf.h
370
--- screenlib/SDL_FrameBuf.h	2000-09-25 02:55:39 +0900
371
+++ screenlib/SDL_FrameBuf.h	2003-05-21 11:27:41 +0900
372
@@ -165,7 +165,7 @@
373
 		va_list ap;
374
 
375
 		va_start(ap, fmt);
376
-		vsprintf(errbuf, fmt, ap);
377
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
378
 		va_end(ap);
379
 		errstr = errbuf;
380
         }
381
(-)./files/patch-buttonlist.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- buttonlist.h.orig	Wed Jan 26 01:41:32 2000
1
--- buttonlist.h.orig	2000-01-25 17:41:32.000000000 +0100
2
+++ buttonlist.h	Sun Aug 22 19:24:13 2004
2
+++ buttonlist.h	2013-03-16 11:40:09.000000000 +0100
3
@@ -16,7 +16,7 @@
3
@@ -16,7 +16,7 @@
4
 
4
 
5
 	void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height, 
5
 	void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height, 
(-)./files/patch-configure (+12 lines)
Line 0 Link Here
1
--- configure.orig	2002-10-20 05:43:07.000000000 +0200
2
+++ configure	2013-03-16 13:28:11.000000000 +0100
3
@@ -3231,6 +3231,9 @@
4
         ac_default_prefix=/boot/beos
5
         GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
6
         ;;
7
+    *-*-freebsd*)
8
+	GAME_INSTALLDIR="\$(prefix)/share/$PACKAGE"
9
+	;;
10
     *)
11
         GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
12
         ;;
(-)./files/patch-controls.cpp (+11 lines)
Line 0 Link Here
1
--- controls.cpp.orig	2001-03-24 19:04:28.000000000 +0100
2
+++ controls.cpp	2013-03-16 13:30:14.000000000 +0100
3
@@ -83,7 +83,7 @@
4
 	if ( fname ) {
5
 		*fname = datafile;
6
 	}
7
-	sprintf(datafile,  "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
8
+	snprintf(datafile, sizeof(datafile), "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
9
 	if ( (data=fopen(datafile, mode)) == NULL )
10
 		return(NULL);
11
 	return(data);
(-)./files/patch-dialog.h (+20 lines)
Line 0 Link Here
1
--- dialog.h.orig	2001-07-20 17:08:10.000000000 +0200
2
+++ dialog.h	2013-03-16 10:15:10.000000000 +0100
3
@@ -92,7 +92,7 @@
4
 		va_list ap;
5
 
6
 		va_start(ap, fmt);
7
-		vsprintf(errbuf, fmt, ap);
8
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
9
 		va_end(ap);
10
 		errstr = errbuf;
11
         }
12
@@ -878,7 +878,7 @@
13
 		if ( entry->text ) {
14
 			Fontserv->FreeText(entry->text);
15
 		}
16
-		sprintf(buf, "%d", *entry->variable);
17
+		snprintf(buf, sizeof(buf), "%d", *entry->variable);
18
 
19
 		if ( entry->hilite ) {
20
 			clear = Fg;
(-)./files/patch-load.cpp (+20 lines)
Line 0 Link Here
1
--- load.cpp.orig	2000-02-15 03:47:39.000000000 +0100
2
+++ load.cpp	2013-03-16 10:17:30.000000000 +0100
3
@@ -81,7 +81,7 @@
4
 	SDL_Surface *bmp, *title;
5
 	
6
 	/* Open the title file -- we know its colormap is our global one */
7
-	sprintf(file, "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
8
+	snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
9
 	bmp = SDL_LoadBMP(path.Path(file));
10
 	if ( bmp == NULL ) {
11
 		return(NULL);
12
@@ -103,7 +103,7 @@
13
 	Uint16 w, h;
14
 	
15
 	/* Open the cicn sprite file.. */
16
-	sprintf(file, "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
17
+	snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
18
 	if ( (cicn_src=SDL_RWFromFile(path.Path(file), "r")) == NULL ) {
19
 		error("GetCIcon(%hd): Can't open CICN %s: ",
20
 					cicn_id, path.Path(file));
(-)./files/patch-maclib-Mac_FontServ.h (+11 lines)
Line 0 Link Here
1
--- maclib/Mac_FontServ.h.orig	1999-12-02 18:15:33.000000000 +0100
2
+++ maclib/Mac_FontServ.h	2013-03-16 10:18:56.000000000 +0100
3
@@ -135,7 +135,7 @@
4
 		va_list ap;
5
 
6
 		va_start(ap, fmt);
7
-		vsprintf(errbuf, fmt, ap);
8
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
9
 		va_end(ap);
10
 		errstr = errbuf;
11
 	}
(-)./files/patch-maclib-Mac_Resource.h (+11 lines)
Line 0 Link Here
1
--- maclib/Mac_Resource.h.orig	1999-12-03 19:01:47.000000000 +0100
2
+++ maclib/Mac_Resource.h	2013-03-16 10:47:19.000000000 +0100
3
@@ -96,7 +96,7 @@
4
 		va_list ap;
5
 
6
 		va_start(ap, fmt);
7
-		vsprintf(errbuf, fmt, ap);
8
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
9
 		va_end(ap);
10
 		errstr = errbuf;
11
 	}
(-)./files/patch-maclib-Mac_Sound.h (+11 lines)
Line 0 Link Here
1
--- maclib/Mac_Sound.h.orig	2002-10-20 04:53:34.000000000 +0200
2
+++ maclib/Mac_Sound.h	2013-03-16 10:48:58.000000000 +0100
3
@@ -199,7 +199,7 @@
4
 		va_list ap;
5
 
6
 		va_start(ap, fmt);
7
-		vsprintf(errbuf, fmt, ap);
8
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
9
 		va_end(ap);
10
 		errstr = errbuf;
11
 	}
(-)./files/patch-maclib-Mac_Wave.h (+11 lines)
Line 0 Link Here
1
--- maclib/Mac_Wave.h.orig	2000-01-25 17:44:10.000000000 +0100
2
+++ maclib/Mac_Wave.h	2013-03-16 10:50:39.000000000 +0100
3
@@ -108,7 +108,7 @@
4
 		va_list ap;
5
 
6
 		va_start(ap, fmt);
7
-		vsprintf(errbuf, fmt, ap);
8
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
9
 		va_end(ap);
10
 		errstr = errbuf;
11
 	}
(-)./files/patch-maclib-macres.cpp (+13 lines)
Line 0 Link Here
1
--- maclib/macres.cpp.orig	2000-01-25 17:44:20.000000000 +0100
2
+++ maclib/macres.cpp	2013-03-16 10:55:45.000000000 +0100
3
@@ -58,8 +58,8 @@
4
 				ids[j], res->ResourceName(types[i], ids[j]));
5
 			if ( argv[2] ) {
6
 				char path[23];
7
-				sprintf(path,"%s/%s:%hu", argv[2],
8
-							types[i], ids[j]);
9
+				snprintf(path, sizeof(path), "%s/%s:%hu",
10
+					argv[2], types[i], ids[j]);
11
 				FILE *output;
12
 				Mac_ResData *D;
13
             			if ( (output=fopen(path, "w")) != NULL ) {
(-)./files/patch-maclib-snd2wav.cpp (+11 lines)
Line 0 Link Here
1
--- maclib/snd2wav.cpp.orig	2001-03-28 05:54:50.000000000 +0200
2
+++ maclib/snd2wav.cpp	2013-03-16 10:58:23.000000000 +0100
3
@@ -82,7 +82,7 @@
4
 			continue;
5
 		}
6
 		wave.Load(snd, rate);
7
-		sprintf(wavname, "snd_%d.wav", ids[i]);
8
+		snprintf(wavname, sizeof(wavname), "snd_%d.wav", ids[i]);
9
 		wave.Save(wavname);
10
 	}
11
 	delete macx;
(-)./files/patch-main.cpp (+34 lines)
Line 0 Link Here
1
--- main.cpp.orig	2002-10-20 04:53:32.000000000 +0200
2
+++ main.cpp	2013-03-16 11:03:28.000000000 +0100
3
@@ -445,7 +445,7 @@
4
 		DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
5
 							0x00, 0x00, 0x00);
6
 	}
7
-	sprintf(text, "%d", gSoundLevel);
8
+	snprintf(text, sizeof(text), "%d", gSoundLevel);
9
 	DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
10
 						30000>>8, 30000>>8, 0xFF);
11
 	screen->Update();
12
@@ -547,11 +547,11 @@
13
 		}
14
 		DrawText(xOff+5, botDiv+42+(index*18), hScores[index].name,
15
 						font, STYLE_BOLD, R, G, B);
16
-		sprintf(buffer, "%u", hScores[index].score);
17
+		snprintf(buffer, sizeof(buffer), "%u", hScores[index].score);
18
 		sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
19
 		DrawText(sRt-sw, botDiv+42+(index*18), buffer, 
20
 						font, STYLE_BOLD, R, G, B);
21
-		sprintf(buffer, "%u", hScores[index].wave);
22
+		snprintf(buffer, sizeof(buffer), "%u", hScores[index].wave);
23
 		sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
24
 		DrawText(wRt-sw, botDiv+42+(index*18), buffer, 
25
 						font, STYLE_BOLD, R, G, B);
26
@@ -560,7 +560,7 @@
27
 
28
 	DrawText(xOff+5, botDiv+46+(10*18)+3, "Last Score: ", 
29
 					bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
30
-	sprintf(buffer, "%d", GetScore());
31
+	snprintf(buffer, sizeof(buffer), "%d", GetScore());
32
 	sw = fontserv->TextWidth("Last Score: ", bigfont, STYLE_NORM);
33
 	DrawText(xOff+5+sw, botDiv+46+(index*18)+3, buffer, 
34
 					bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
(-)./files/patch-myerror.cpp (+29 lines)
Line 0 Link Here
1
--- myerror.cpp.orig	1998-07-14 03:50:17.000000000 +0200
2
+++ myerror.cpp	2013-03-16 12:24:50.000000000 +0100
3
@@ -16,7 +16,7 @@
4
 	va_list ap;
5
 
6
 	va_start(ap, fmt);
7
-	vsprintf(mesg, fmt, ap);
8
+	vsnprintf(mesg, sizeof(mesg), fmt, ap);
9
 	fputs(mesg, stderr);
10
 	va_end(ap);
11
 }
12
@@ -27,7 +27,7 @@
13
 	va_list ap;
14
 
15
 	va_start(ap, fmt);
16
-	vsprintf(mesg, fmt, ap);
17
+	vsnprintf(mesg, sizeof(mesg), fmt, ap);
18
 	fputs(mesg, stdout);
19
 	va_end(ap);
20
 }
21
@@ -37,7 +37,7 @@
22
 	char buffer[BUFSIZ];
23
 
24
 	if ( *msg ) {
25
-		sprintf(buffer, "%s: %s\n", msg, strerror(errno));
26
+		snprintf(buffer, sizeof(buffer), "%s: %s\n", msg, strerror(errno));
27
 		error(buffer);
28
 	} else
29
 		error((char *)strerror(errno));
(-)./files/patch-netlogic-game.cpp (+127 lines)
Line 0 Link Here
1
--- netlogic/game.cpp.orig	2001-07-23 04:24:03.000000000 +0200
2
+++ netlogic/game.cpp	2013-03-16 13:13:14.000000000 +0100
3
@@ -232,7 +232,7 @@
4
 
5
 			lastDisplayed = gDisplayed;
6
 			screen->FillRect(0, 0, SCREEN_WIDTH, 12, ourBlack);
7
-			sprintf(caption,
8
+			snprintf(caption, sizeof(caption),
9
 				"You are player %d --- displaying player %d",
10
 						gOurPlayer+1, gDisplayed+1);
11
 			DrawText(SPRITES_WIDTH, 11, caption, geneva,
12
@@ -357,7 +357,7 @@
13
 				/* -- Erase old and draw new score */
14
 				screen->FillRect(45, gStatusLine+1,
15
 					score_width, text_height, ourBlack);
16
-				sprintf(numbuf, "%d", Score);
17
+				snprintf(numbuf, sizeof(numbuf), "%d", Score);
18
 				score_width = DrawText(45, gStatusLine+11, 
19
 						numbuf, geneva, STYLE_BOLD,
20
 							0xFF, 0xFF, 0xFF);
21
@@ -380,7 +380,7 @@
22
 		if (lastWave != gWave) {
23
 			screen->FillRect(255, gStatusLine+1,
24
 					wave_width, text_height, ourBlack);
25
-			sprintf(numbuf, "%d", gWave);
26
+			snprintf(numbuf, sizeof(numbuf), "%d", gWave);
27
 			wave_width = DrawText(255, gStatusLine+11, 
28
 					numbuf, geneva, STYLE_BOLD,
29
 							0xFF, 0xFF, 0xFF);
30
@@ -391,7 +391,7 @@
31
 		if (lastLives != Lives) {
32
 			screen->FillRect(319, gStatusLine+1,
33
 					lives_width, text_height, ourBlack);
34
-			sprintf(numbuf, "%-3.1d", Lives);
35
+			snprintf(numbuf, sizeof(numbuf), "%-3.1d", Lives);
36
 			lives_width = DrawText(319, gStatusLine+11,
37
 					numbuf, geneva, STYLE_BOLD,
38
 							0xFF, 0xFF, 0xFF);
39
@@ -402,7 +402,7 @@
40
 		if (lastBonus != Bonus) {
41
 			screen->FillRect(384, gStatusLine+1,
42
 					bonus_width, text_height, ourBlack);
43
-			sprintf(numbuf, "%-7.1d", Bonus);
44
+			snprintf(numbuf, sizeof(numbuf), "%-7.1d", Bonus);
45
 			bonus_width = DrawText(384, gStatusLine+11,
46
 					numbuf, geneva, STYLE_BOLD,
47
 							0xFF, 0xFF, 0xFF);
48
@@ -414,7 +414,7 @@
49
 			if (lastFrags != Frags) {
50
 				screen->FillRect(fragoff, gStatusLine+1,
51
 					frags_width, text_height, ourBlack);
52
-				sprintf(numbuf, "%-3.1d", Frags);
53
+				snprintf(numbuf, sizeof(numbuf), "%-3.1d", Frags);
54
 				frags_width = DrawText(fragoff, gStatusLine+11,
55
 						numbuf, geneva, STYLE_BOLD,
56
 							0xFF, 0xFF, 0xFF);
57
@@ -747,10 +747,11 @@
58
 		for ( i=0; i<gNumPlayers; ++i ) {
59
 			char buffer[BUFSIZ], num1[12], num2[12];
60
 
61
-			sprintf(num1, "%7.1d", final[i].Score);
62
-			sprintf(num2, "%3.1d", final[i].Frags);
63
-			sprintf(buffer, "Player %d: %-.7s Points, %-.3s Frags",
64
-						final[i].Player, num1, num2);
65
+			snprintf(num1, sizeof(num1), "%7.1d", final[i].Score);
66
+			snprintf(num2, sizeof(num2), "%3.1d", final[i].Frags);
67
+			snprintf(buffer, sizeof(buffer),
68
+				 "Player %d: %-.7s Points, %-.3s Frags",
69
+				 final[i].Player, num1, num2);
70
 			DrawText(160, 380+i*newyork_height, buffer,
71
 				newyork, STYLE_NORM, 30000>>8, 30000>>8, 0xFF);
72
 		}
73
@@ -898,7 +899,7 @@
74
 	
75
 
76
 	/* -- Draw the wave completed message */
77
-	sprintf(numbuf, "Wave %d completed.", gWave);
78
+	snprintf(numbuf, sizeof(numbuf), "Wave %d completed.", gWave);
79
 	sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
80
 	x = (SCREEN_WIDTH - sw) / 2;
81
 	DrawText(x,  150, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
82
@@ -935,7 +936,7 @@
83
 		if (OurShip->GetBonusMult() != 1) {
84
 			SDL_Surface *sprite;
85
 
86
-			sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
87
+			snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
88
 			DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
89
 							0xFF, 0xFF, 0xFF);
90
 			x += 75;
91
@@ -951,10 +952,10 @@
92
 	Delay(SOUND_DELAY);
93
 	sound->PlaySound(gFunk, 5);
94
 
95
-	sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
96
+	snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
97
 	bonus_width = DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
98
 							0xFF, 0xFF, 0xFF);
99
-	sprintf(numbuf, "%-5.1d", OurShip->GetScore());
100
+	snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
101
 	score_width = DrawText(xt, 220, numbuf, geneva, STYLE_BOLD,
102
 							0xFF, 0xFF, 0xFF);
103
 	screen->Update();
104
@@ -997,12 +998,12 @@
105
 	
106
 			screen->FillRect(x, 200-text_height+2,
107
 					bonus_width, text_height, ourBlack);
108
-			sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
109
+			snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
110
 			bonus_width = DrawText(x, 200, numbuf,
111
 					geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
112
 			screen->FillRect(xt, 220-text_height+2,
113
 					score_width, text_height, ourBlack);
114
-			sprintf(numbuf, "%-5.1d", OurShip->GetScore());
115
+			snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
116
 			score_width = DrawText(xt, 220, numbuf,
117
 					geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
118
 
119
@@ -1015,7 +1016,7 @@
120
 	HandleEvents(10);
121
 
122
 	/* -- Draw the "next wave" message */
123
-	sprintf(numbuf, "Prepare for Wave %d...", gWave+1);
124
+	snprintf(numbuf, sizeof(numbuf), "Prepare for Wave %d...", gWave+1);
125
 	sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
126
 	x = (SCREEN_WIDTH - sw)/2;
127
 	DrawText(x, 259, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
(-)./files/patch-netlogic-netplay.cpp (+22 lines)
Line 0 Link Here
1
--- netlogic/netplay.cpp.orig	2002-10-20 06:11:52.000000000 +0200
2
+++ netlogic/netplay.cpp	2013-03-16 13:16:57.000000000 +0100
3
@@ -670,7 +670,9 @@
4
 		strcpy(message, "Waiting for players:");
5
 		for ( i=0; i<gNumPlayers; ++i ) {
6
 			if ( ! acked[i] )
7
-				sprintf(&message[strlen(message)], " %d", i+1);
8
+				snprintf(&message[strlen(message)],
9
+					 sizeof(message)-strlen(message),
10
+					 " %d", i+1);
11
 		}
12
 		Message(message);
13
 
14
@@ -725,7 +727,7 @@
15
 			/* Check the player... */
16
 			if ( (i != gOurPlayer) && (netbuf[1] == gOurPlayer) ) {
17
 				/* Print message, sleep 3 seconds absolutely */
18
-				sprintf(message, 
19
+			  snprintf(message, sizeof(message),
20
 	"Error: Another player (%d) thinks they are player 1!\r\n", i+1);
21
 				ErrorMessage(message);
22
 				/* Suck up retransmission packets */
(-)./files/patch-netscore.cpp (+11 lines)
Line 0 Link Here
1
--- netscore.cpp.orig	2001-07-23 05:25:17.000000000 +0200
2
+++ netscore.cpp	2013-03-16 11:30:57.000000000 +0100
3
@@ -59,7 +59,7 @@
4
 
5
 	/* Send the scores */
6
 	crc = get_checksum(key, KEY_LEN);
7
-	sprintf(netbuf, SCOREFMT, crc, high.name, high.score, high.wave);
8
+	snprintf(netbuf, sizeof(netbuf), SCOREFMT, crc, high.name, high.score, high.wave);
9
 	SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
10
 	n = SDLNet_TCP_Recv(remote, netbuf, 1024);
11
 	if ( n > 0 ) {
(-)./files/patch-screenlib-SDL_FrameBuf.cpp (-2 / +11 lines)
Lines 1-5 Link Here
1
--- screenlib/SDL_FrameBuf.cpp.old	2006-10-25 22:37:21.000000000 +0200
1
--- screenlib/SDL_FrameBuf.cpp.orig	2001-07-22 23:03:13.000000000 +0200
2
+++ screenlib/SDL_FrameBuf.cpp	2006-10-25 22:38:26.000000000 +0200
2
+++ screenlib/SDL_FrameBuf.cpp	2013-03-16 11:45:02.000000000 +0100
3
@@ -628,7 +628,7 @@
4
 
5
 		found = 0;
6
 		for ( which=0; !found; ++which ) {
7
-			sprintf(file, "%s%d.bmp", prefix, which);
8
+			snprintf(file, sizeof(file), "%s%d.bmp", prefix, which);
9
 			if ( ((fp=fopen(file, "r")) == NULL) &&
10
 			     ((fp=fopen(file, "w")) != NULL) ) {
11
 				found = 1;
3
@@ -847,10 +847,8 @@
12
@@ -847,10 +847,8 @@
4
 			/* Update the dirty rectangle map with the new list */
13
 			/* Update the dirty rectangle map with the new list */
5
 			for ( i=0; i<dirtymaplen; ++i ) {
14
 			for ( i=0; i<dirtymaplen; ++i ) {
(-)./files/patch-screenlib-SDL_FrameBuf.h (+11 lines)
Line 0 Link Here
1
--- screenlib/SDL_FrameBuf.h.orig	2000-09-24 19:55:39.000000000 +0200
2
+++ screenlib/SDL_FrameBuf.h	2013-03-16 11:33:01.000000000 +0100
3
@@ -165,7 +165,7 @@
4
 		va_list ap;
5
 
6
 		va_start(ap, fmt);
7
-		vsprintf(errbuf, fmt, ap);
8
+		vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
9
 		va_end(ap);
10
 		errstr = errbuf;
11
         }
(-)./pkg-plist (-56 / +37 lines)
Lines 1-58 Link Here
1
bin/Maelstrom
1
bin/Maelstrom
2
bin/Maelstrom-netd
2
bin/Maelstrom-netd
3
%%PORTDOCS%%share/doc/Maelstrom/Ambrosia_Software,_Inc._FAQ
3
%%DATADIR%%/Images/Maelstrom_Icon#100.cicn
4
%%PORTDOCS%%share/doc/Maelstrom/COPYING
4
%%DATADIR%%/Images/Maelstrom_Icon#101.cicn
5
%%PORTDOCS%%share/doc/Maelstrom/COPYING.GPL
5
%%DATADIR%%/Images/Maelstrom_Icon#102.cicn
6
%%PORTDOCS%%share/doc/Maelstrom/Maelstrom-Announce
6
%%DATADIR%%/Images/Maelstrom_Icon#103.cicn
7
%%PORTDOCS%%share/doc/Maelstrom/Maelstrom.FAQ
7
%%DATADIR%%/Images/Maelstrom_Icon#104.cicn
8
%%PORTDOCS%%share/doc/Maelstrom/MaelstromGPL_press_release
8
%%DATADIR%%/Images/Maelstrom_Icon#110.cicn
9
%%PORTDOCS%%share/doc/Maelstrom/Makefile
9
%%DATADIR%%/Images/Maelstrom_Icon#128.cicn
10
%%PORTDOCS%%share/doc/Maelstrom/Makefile.in
10
%%DATADIR%%/Images/Maelstrom_Icon#129.cicn
11
%%PORTDOCS%%share/doc/Maelstrom/Networking.Paper
11
%%DATADIR%%/Images/Maelstrom_Icon#130.cicn
12
%%PORTDOCS%%share/doc/Maelstrom/Porting.Paper
12
%%DATADIR%%/Images/Maelstrom_Icon#131.cicn
13
%%PORTDOCS%%share/doc/Maelstrom/Quotes
13
%%DATADIR%%/Images/Maelstrom_Icon#132.cicn
14
%%PORTDOCS%%share/doc/Maelstrom/README
14
%%DATADIR%%/Images/Maelstrom_Icon#133.cicn
15
%%PORTDOCS%%share/doc/Maelstrom/README.joystick
15
%%DATADIR%%/Images/Maelstrom_Icon#134.cicn
16
%%PORTDOCS%%share/doc/Maelstrom/README.network
16
%%DATADIR%%/Images/Maelstrom_Icon#135.cicn
17
%%PORTDOCS%%share/doc/Maelstrom/README.options
17
%%DATADIR%%/Images/Maelstrom_Icon#136.cicn
18
%%PORTDOCS%%share/doc/Maelstrom/RSA.README
18
%%DATADIR%%/Images/Maelstrom_Icon#137.cicn
19
%%PORTDOCS%%share/doc/Maelstrom/Technical_Notes-v1.0
19
%%DATADIR%%/Images/Maelstrom_Titles#100.bmp
20
%%PORTDOCS%%share/doc/Maelstrom/Technical_Notes-v1.1
20
%%DATADIR%%/Images/Maelstrom_Titles#101.bmp
21
%%PORTDOCS%%share/doc/Maelstrom/Technical_Notes-v2.0
21
%%DATADIR%%/Images/Maelstrom_Titles#102.bmp
22
share/Maelstrom/Images/Maelstrom_Icon#100.cicn
22
%%DATADIR%%/Images/Maelstrom_Titles#128.bmp
23
share/Maelstrom/Images/Maelstrom_Icon#101.cicn
23
%%DATADIR%%/Images/Maelstrom_Titles#129.bmp
24
share/Maelstrom/Images/Maelstrom_Icon#102.cicn
24
%%DATADIR%%/Images/Maelstrom_Titles#130.bmp
25
share/Maelstrom/Images/Maelstrom_Icon#103.cicn
25
%%DATADIR%%/Images/Maelstrom_Titles#133.bmp
26
share/Maelstrom/Images/Maelstrom_Icon#104.cicn
26
%%DATADIR%%/Images/Maelstrom_Titles#134.bmp
27
share/Maelstrom/Images/Maelstrom_Icon#110.cicn
27
%%DATADIR%%/Images/Maelstrom_Titles#135.bmp
28
share/Maelstrom/Images/Maelstrom_Icon#128.cicn
28
%%DATADIR%%/Images/Maelstrom_Titles#999.bmp
29
share/Maelstrom/Images/Maelstrom_Icon#129.cicn
29
%%DATADIR%%/Images/Makefile
30
share/Maelstrom/Images/Maelstrom_Icon#130.cicn
30
%%DATADIR%%/Images/Makefile.in
31
share/Maelstrom/Images/Maelstrom_Icon#131.cicn
31
%%DATADIR%%/Maelstrom-Scores
32
share/Maelstrom/Images/Maelstrom_Icon#132.cicn
32
%%DATADIR%%/Maelstrom_Fonts
33
share/Maelstrom/Images/Maelstrom_Icon#133.cicn
33
%%DATADIR%%/Maelstrom_Sounds
34
share/Maelstrom/Images/Maelstrom_Icon#134.cicn
34
%%DATADIR%%/Maelstrom_Sprites
35
share/Maelstrom/Images/Maelstrom_Icon#135.cicn
35
%%DATADIR%%/icon.bmp
36
share/Maelstrom/Images/Maelstrom_Icon#136.cicn
36
%%DATADIR%%/icon.xpm
37
share/Maelstrom/Images/Maelstrom_Icon#137.cicn
37
share/pixmaps/maelstrom.png
38
share/Maelstrom/Images/Maelstrom_Titles#100.bmp
38
@dirrm %%DATADIR%%/Images
39
share/Maelstrom/Images/Maelstrom_Titles#101.bmp
39
@dirrm %%DATADIR%%
40
share/Maelstrom/Images/Maelstrom_Titles#102.bmp
41
share/Maelstrom/Images/Maelstrom_Titles#128.bmp
42
share/Maelstrom/Images/Maelstrom_Titles#129.bmp
43
share/Maelstrom/Images/Maelstrom_Titles#130.bmp
44
share/Maelstrom/Images/Maelstrom_Titles#133.bmp
45
share/Maelstrom/Images/Maelstrom_Titles#134.bmp
46
share/Maelstrom/Images/Maelstrom_Titles#135.bmp
47
share/Maelstrom/Images/Maelstrom_Titles#999.bmp
48
share/Maelstrom/Images/Makefile
49
share/Maelstrom/Images/Makefile.in
50
share/Maelstrom/Maelstrom-Scores
51
share/Maelstrom/Maelstrom_Fonts
52
share/Maelstrom/Maelstrom_Sounds
53
share/Maelstrom/Maelstrom_Sprites
54
share/Maelstrom/icon.bmp
55
share/Maelstrom/icon.xpm
56
@dirrm share/Maelstrom/Images
57
@dirrm share/Maelstrom
58
%%PORTDOCS%%@dirrm share/doc/Maelstrom

Return to bug 176997