mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
Maelstrom: fix build for gcc8
* add gentoo patches * add hvif icon
This commit is contained in:
108
games-action/maelstrom/additional-files/maelstrom.rdef.in
Normal file
108
games-action/maelstrom/additional-files/maelstrom.rdef.in
Normal file
@@ -0,0 +1,108 @@
|
||||
resource app_flags B_SINGLE_LAUNCH;
|
||||
|
||||
resource app_version {
|
||||
major = @MAJOR@,
|
||||
middle = @MIDDLE@,
|
||||
minor = @MINOR@,
|
||||
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 0,
|
||||
|
||||
short_info = "Blast the Asteroids!",
|
||||
long_info = "@LONG_INFO@"
|
||||
};
|
||||
|
||||
resource app_signature "@APP_SIGNATURE@";
|
||||
|
||||
resource vector_icon array {
|
||||
$"6E63696604031D1D1B03E6E4DA05FF0400771F0211B8B1BD91B7AEBE7CB967BC"
|
||||
$"EBBAAFBA1BB8C9BB25BC95B910BDAFB96FBDAFB96FBDF9B94ABE9AB928BE48B9"
|
||||
$"32BF1FB919C18BB8ABBFDBB967C33BB7EEC577B72BC3FFB73AC6F0B71CCA57B8"
|
||||
$"9CC94CB7A1CB63B997CCDBBE6FCB72BC49CE45C095CF7FC3ECCF86C273CF77C5"
|
||||
$"64CCF3C8FACE8BC6D6CC02CA50C9C3CCAFCAF1CB8EC945CD1EC5F6CE38C804CE"
|
||||
$"67C3E8CE0AC146CCEFC20ACD1EC084CCB3BEF2CCE0BFB6CCAEBDDFCD35BBA2CD"
|
||||
$"6EBCC2CD64BADECD5FB80DC9FFB908CC25B711C7D9B5F1C14DB599C2C6B649BF"
|
||||
$"D50211B97CBDB8B927BE35B9D0BD3ABAD6BB05BA39BB7BBB73BA8FBD42BA2ABC"
|
||||
$"FBB9F2BDDABAE9BF9EBBA2BEAFBB6DC155BC18C3BABB0DC28FBC27C463BA7EC4"
|
||||
$"A7B8C9C4BBB9A5C4B0B88BC4EDB81DC4C8B84FC50DB805C9DCB967C8F9B844CA"
|
||||
$"BFBA8ACC48BFA8CAF7BDB1CD9AC19ECE56C3E3CE56C2A0CE56C526CC9FC7D7CE"
|
||||
$"00C63FCB3EC96FC84DCCDEC948CC68C72CCD5BC4B7CD43C5ECCD7EC38ECD05C0"
|
||||
$"2ECBD2C23CCB9CBE20CC08BB6BCC75BD13CCFDB9C3CBEEB7AEC5EFB843C82BB7"
|
||||
$"1AC3B2B719C0A1B655C1DBB7DDBF680003BE47BA0ABE47BA0ABE70BA01C045B9"
|
||||
$"D3BEE4BA0AC1A5B99CC37CB8A1C35DB86BC37CB8A10206BAD8BCAEBAE6BCC2BA"
|
||||
$"F3BC20BB99BB35BB36BB9DBBE2BB0CBCD3BAECBCC4BAC8BCE2BB11BCE4BB60BD"
|
||||
$"0DBB4ABCBABB75BBE9BBC3BC03BB7FBBC2BC21BB56BCCEBB91BC7BBB34BCE700"
|
||||
$"03B85D41B85D41B87EC00BB90AC065B91EC041B8F6C08AB853C1A4B853C102B8"
|
||||
$"53C1A40205C704B9D0C6A8B9FAC76BB99AC846B9E8C7E8B9A3C8A3BA2DC8BBBB"
|
||||
$"14C8D1BAA2C88DBC34C69CBBC2C714BC2FC658BB77C651BAAEC63DBB11C666BA"
|
||||
$"4C0205C744BA5BC716BA6FC778BA3FC7E6BA66C7B7BA43C815BA89C821BAFEC8"
|
||||
$"2CBAC4C809BB8EC70FBB54C74CBB8CC6EEBB2FC6EABACAC6E0BAFBC6F5BA9902"
|
||||
$"03C150BD46C07EBD79C1B6BD2BC29ABE47C2B1BD4CC284BF42C0F3BECEC165BF"
|
||||
$"08C081BE950204C17DBDC3C15ABDCDC1AABDB8C20BBE34C216BDC3C200BEA5C1"
|
||||
$"55BE6FC186BE87C139BE57C136BE0DC12DBE31C13EBDE90209BC9DBF5BBB8EBF"
|
||||
$"FBBD50BF06C050BFC3BF11BF37C18FC050C0BBC2BFC138C107C03DC476BF74C6"
|
||||
$"13BFCDC5A2BF1BC67CBE25C6F9BEA7C6CBBDE1C703BCACC6D4BCE1C70EBC6AC6"
|
||||
$"67BB88C5EFBC02C615BAE6C5CFB9DBC513BA3EC5EFB973C40FBA19C1F8B98AC2"
|
||||
$"E9BAAFC0E3020939BFC8BC5AC0023ABFA3BFA4C037BF0CC007C03CC066C090C1"
|
||||
$"42C09FC0BEC045C245BF86C43DBFECC344BF19C568BE75C60FBF19C5ACBDD2C6"
|
||||
$"72BD31C66DBD5BC697BCD3C5F9BBC9C572BC57C5A2BB0DC544BA6BC4E6BA7FC5"
|
||||
$"1EBA29C406BA9BC242BA3AC316BB2AC1380205C62DBD9DC452BEA9C78EBD02C9"
|
||||
$"D6BEF2C92BBD98CA2BBF8ACA0DC0E6CA3FC03FC9DBC18EC8CCC26AC967C21AC7"
|
||||
$"C2C2DEC4DFC1D8C5BBC322C404C08D0007C77BBDE7C77BBDE7C83FBE02C943BF"
|
||||
$"2BC8E9BE7BC9CBC03CC939C165C997C0E3C88CC22BC681C246C781C281C5C6C2"
|
||||
$"21C519C0CDC536C18AC50FC080C519BFF7C504BFF7C52EBFF7C5EBC116C5C0C1"
|
||||
$"22C5EBC1160204BAE1C360BB1DC3E3BAD1C33BBB49C318BB20C2F3BB73C33CBC"
|
||||
$"0FC4BABC35C4A1BBEAC4D3BBB1C4D9BBCCC4E3BB62C4610003BBA2C222BBA2C2"
|
||||
$"22BBAAC1FDBC0AC1E3BBE6C1CEBC72C292BD06C40EBCC6C34CBD06C40E0204BC"
|
||||
$"88C11DBCC6C1C9BC80C103BCEBC0D4BCCCC0BEBD44C16ABDA7C2BABD84C20EBD"
|
||||
$"9DC302BD5FC318BD79C32DBD0EC2730204BDA2C08ABDB3C0E8BDA2C06BBE20C0"
|
||||
$"6ABE0BC05BBE48C0B4BE5AC15BBE5CC107BE44C18BBE06C195BE25C1B9BDD5C1"
|
||||
$"420204C2A4C395C1DEC3F348C374C38AC3B1C348C37FC3CCC3E3C3E3C486C3EE"
|
||||
$"C434C3E3C577C236C523C2A4C581C1C7C4C50205C2CFC415C2ADC41EC2EDC40A"
|
||||
$"C329C424C30FC410C342C437C34CC477C350C457C34CC4D9C29EC4B7C2CFC4DE"
|
||||
$"C287C49DC289C459C27FC47AC293C4370204CB37C22ACA3EC2A0CB96C201CC56"
|
||||
$"C24DCC03C20ECCA9C28BCCC6C358CCD3C2F1CCC6C485CAAEC41CCB37C492CA25"
|
||||
$"C3A60205CB5FC2A3CB27C2B4CB94C28CCBFFC2B7CBD1C294CC2CC2D9CC3DC34B"
|
||||
$"CC44C312CC3DC3F3CB12C3B8CB5FC3FACAEBC38DCAECC319CADDC351CAFCC2E0"
|
||||
$"0204BEE1C893BE8AC8ADBF75C84FC079C9CDC0BDC8B3C036CAE7BE83CA41BEEB"
|
||||
$"CA9ABE3ECA04BE34C94EBE20C9A7BE47C8F50204BF11C8F0BEDDC902BF6BC8C7"
|
||||
$"C00CC9B1C036C903BFE3CA60BED7C9F8BF17CA2FBEB0C9D2BEAAC964BE9EC99A"
|
||||
$"BEB6C92E020AC480C804C3D4C86DC4EDC7DCC63CC823C552C867C727C7E0C90E"
|
||||
$"C791C833C771C99BC793CA2EC882CA13C7F8CA38C8F2C9F9C9CCCA26C964C988"
|
||||
$"CA40C893CB15C911CAAEC820CB83C75ECBD6C7DCCBEBC6E1CBC1C5C6CB69C688"
|
||||
$"CB6EC543CB72C444CB2FC4BFCB5EC3E1CB01C31FC9D6C314CA5349C91404020E"
|
||||
$"C446C8D6C470CA10C450CA06C470CA100204C4CFC543C4DEC54DC4AEC52CC54D"
|
||||
$"C51EC532C509C567C533C5EAC6E0C60EC6C6C5C2C6F2C56CC6FAC597C6FBC56C"
|
||||
$"C6FA0204C58BC452C5A6C4E5C59EC43FC609C41DC5EAC404C64CC4AFC677C5EF"
|
||||
$"C671C54EC65DC60EC5FAC604C604C623C5CBC5760204C6C5C3E9C6C1C46FC6D6"
|
||||
$"C3D4C728C3DFC71EC3BBC747C462C758C56DC757C4E7C743C57EC6E5C577C6F5"
|
||||
$"C5A2C6CBC4F40204C971C662C967C658C982C672CAFDC7B1CAFDC76FCAFDC7F4"
|
||||
$"CAA1C7F5CAF5C82FCA1EC79DC929C6D6C9A0C73DC929C6BB0204C98EC57CCA18"
|
||||
$"C62AC988C55FC9E7C539C9C8C52ECA07C543CBA9C719CBC3C705CB8EC72DCB5B"
|
||||
$"C758CB74C758CAB2C6C90204CA92C4F8CAA1C509CA92C4F8CAF0C4BACAC7C49F"
|
||||
$"CB1AC4D4CC3FC643CC4AC61DCC35C668CBE1C697CBFCC6A6CBC7C688200A0301"
|
||||
$"00123EFDD6BB4EB53B391B3F3FAE3E0EC14722A401158200040A000100123FA2"
|
||||
$"CFBBCED83BEAD93FBD8CC7843444775101158200040A010101023FA2CFBBCED8"
|
||||
$"3BEAD93FBD8CC784344477510A020102023FA2CFBBCED83BEAD93FBD8CC78434"
|
||||
$"4477510A000103023FA2CFBBCED83BEAD93FBD8CC784344477510A000104023F"
|
||||
$"A2CFBBCED83BEAD93FBD8CC784344477510A000105023FA2CFBBCED83BEAD93F"
|
||||
$"BD8CC784344477510A020106023FA2CFBBCED83BEAD93FBD8CC784344477510A"
|
||||
$"000107023FA2CFBBCED83BEAD93FBD8CC784344477510A020108023FA2CFBBCE"
|
||||
$"D83BEAD93FBD8CC784344477510A000109023FA2CFBBCED83BEAD93FBD8CC784"
|
||||
$"344477510A02010A023FA2CFBBCED83BEAD93FBD8CC784344477510A00010B02"
|
||||
$"3FA2CFBBCED83BEAD93FBD8CC784344477510A02010C023FA2CFBBCED83BEAD9"
|
||||
$"3FBD8CC784344477510A00010D023FA2CFBBCED83BEAD93FBD8CC78434447751"
|
||||
$"0A00010E023FA2CFBBCED83BEAD93FBD8CC784344477510A00010F023FA2CFBB"
|
||||
$"CED83BEAD93FBD8CC784344477510A000110023FA2CFBBCED83BEAD93FBD8CC7"
|
||||
$"84344477510A000111023FA2CFBBCED83BEAD93FBD8CC784344477510A020112"
|
||||
$"023FA2CFBBCED83BEAD93FBD8CC784344477510A000113023FA2CFBBCED83BEA"
|
||||
$"D93FBD8CC784344477510A020114023FA2CFBBCED83BEAD93FBD8CC784344477"
|
||||
$"510A000115023FA2CFBBCED83BEAD93FBD8CC784344477510A020116023FA2CF"
|
||||
$"BBCED83BEAD93FBD8CC784344477510A000117023FA2CFBBCED83BEAD93FBD8C"
|
||||
$"C784344477510A020118023FA2CFBBCED83BEAD93FBD8CC784344477510A0001"
|
||||
$"19023FA2CFBBCED83BEAD93FBD8CC784344477510A00011A023FA2CFBBCED83B"
|
||||
$"EAD93FBD8CC784344477510A00011B023FA2CFBBCED83BEAD93FBD8CC7843444"
|
||||
$"77510A00011C023FA2CFBBCED83BEAD93FBD8CC784344477510A00011D023FA2"
|
||||
$"CFBBCED83BEAD93FBD8CC784344477510A00011E023FA2CFBBCED83BEAD93FBD"
|
||||
$"8CC78434447751"
|
||||
};
|
||||
@@ -16,11 +16,19 @@ home..."
|
||||
HOMEPAGE="http://www.libsdl.org/projects/Maelstrom"
|
||||
COPYRIGHT="1996-2005 Sam Lantinga"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="3"
|
||||
REVISION="4"
|
||||
SOURCE_URI="http://www.libsdl.org/projects/Maelstrom/src/Maelstrom-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="e7983c2c7376cdcca1944db1706d92aedd529638cf13358c88a60df982ba7b46"
|
||||
SOURCE_DIR="Maelstrom-$portVersion"
|
||||
PATCHES="maelstrom-$portVersion.patchset"
|
||||
PATCHES="
|
||||
maelstrom-3.0.6-64bits.patch
|
||||
maelstrom-3.0.6-gcc34.patch
|
||||
maelstrom-3.0.6-gcc53.patch
|
||||
maelstrom-3.0.6-security.patch
|
||||
maelstrom-3.0.6-warnings.patch
|
||||
maelstrom-$portVersion.patchset
|
||||
"
|
||||
ADDITIONAL_FILES="maelstrom.rdef.in"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
|
||||
@@ -71,5 +79,20 @@ INSTALL()
|
||||
cp Maelstrom $appsDir/Maelstrom/
|
||||
cp Maelstrom-netd $binDir
|
||||
|
||||
local APP_SIGNATURE="application/x-vnd.maelstrom"
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
|
||||
local MINOR="`echo "$portVersion" | cut -d. -f3`"
|
||||
local LONG_INFO="$SUMMARY"
|
||||
sed \
|
||||
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
|
||||
-e "s|@MAJOR@|$MAJOR|" \
|
||||
-e "s|@MIDDLE@|$MIDDLE|" \
|
||||
-e "s|@MINOR@|$MINOR|" \
|
||||
-e "s|@LONG_INFO@|$LONG_INFO|" \
|
||||
$portDir/additional-files/maelstrom.rdef.in > $sourceDir/maelstrom.rdef
|
||||
|
||||
addResourcesToBinaries $sourceDir/maelstrom.rdef $appsDir/Maelstrom/Maelstrom
|
||||
|
||||
addAppDeskbarSymlink $appsDir/Maelstrom/Maelstrom
|
||||
}
|
||||
|
||||
15
games-action/maelstrom/patches/maelstrom-3.0.6-64bits.patch
Normal file
15
games-action/maelstrom/patches/maelstrom-3.0.6-64bits.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
--- a/screenlib/SDL_FrameBuf.cpp 2006-10-25 22:37:21.000000000 +0200
|
||||
+++ b/screenlib/SDL_FrameBuf.cpp 2006-10-25 22:38:26.000000000 +0200
|
||||
@@ -847,10 +847,8 @@
|
||||
/* Update the dirty rectangle map with the new list */
|
||||
for ( i=0; i<dirtymaplen; ++i ) {
|
||||
if ( dirtymap[i] != NULL ) {
|
||||
- dirtymap[i] = (SDL_Rect *)(
|
||||
- ((int)dirtymap[i]-(int)updatelist) +
|
||||
- (int)newlist
|
||||
- );
|
||||
+ dirtymap[i] = newlist
|
||||
+ + (dirtymap[i]-updatelist);
|
||||
}
|
||||
}
|
||||
delete[] updatelist;
|
||||
30
games-action/maelstrom/patches/maelstrom-3.0.6-gcc34.patch
Normal file
30
games-action/maelstrom/patches/maelstrom-3.0.6-gcc34.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
diff -ur Maelstrom-3.0.6-orig/buttonlist.h Maelstrom-3.0.6/buttonlist.h
|
||||
--- Maelstrom-3.0.6-orig/buttonlist.h 2004-08-28 01:43:55.867378220 -0400
|
||||
+++ Maelstrom-3.0.6/buttonlist.h 2004-08-28 01:44:23.700062593 -0400
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height,
|
||||
void (*callback)(void)) {
|
||||
- struct button *belem;
|
||||
+ button *belem;
|
||||
|
||||
for ( belem=&button_list; belem->next; belem=belem->next );
|
||||
belem->next = new button;
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
void Activate_Button(Uint16 x, Uint16 y) {
|
||||
- struct button *belem;
|
||||
+ button *belem;
|
||||
|
||||
for ( belem=button_list.next; belem; belem=belem->next ) {
|
||||
if ( (x >= belem->x1) && (x <= belem->x2) &&
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
void Delete_Buttons(void) {
|
||||
- struct button *belem, *btemp;
|
||||
+ button *belem, *btemp;
|
||||
|
||||
for ( belem=button_list.next; belem; ) {
|
||||
btemp = belem;
|
||||
11
games-action/maelstrom/patches/maelstrom-3.0.6-gcc53.patch
Normal file
11
games-action/maelstrom/patches/maelstrom-3.0.6-gcc53.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- Maelstrom-3.0.6/Maelstrom-netd.c.orig 2016-06-04 06:02:44.000000000 +0300
|
||||
+++ Maelstrom-3.0.6/Maelstrom-netd.c 2016-06-05 13:45:11.422533649 +0300
|
||||
@@ -204,7 +204,7 @@
|
||||
memset(&serv_addr, 0, sizeof(serv_addr));
|
||||
serv_addr.sin_family = AF_INET;
|
||||
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
- serv_addr.sin_port = htons(NETPLAY_PORT-1);
|
||||
+ serv_addr.sin_port = htons(NETPLAY_PORT - 1);
|
||||
if (bind(netfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
|
||||
perror("Can't bind local address");
|
||||
exit(3);
|
||||
380
games-action/maelstrom/patches/maelstrom-3.0.6-security.patch
Normal file
380
games-action/maelstrom/patches/maelstrom-3.0.6-security.patch
Normal file
@@ -0,0 +1,380 @@
|
||||
diff -ur Maelstrom-3.0.6-orig/controls.cpp Maelstrom-3.0.6/controls.cpp
|
||||
--- Maelstrom-3.0.6-orig/controls.cpp 2001-03-25 03:04:28 +0900
|
||||
+++ Maelstrom-3.0.6/controls.cpp 2003-05-21 11:25:53 +0900
|
||||
@@ -83,7 +83,7 @@
|
||||
if ( fname ) {
|
||||
*fname = datafile;
|
||||
}
|
||||
- sprintf(datafile, "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
|
||||
+ snprintf(datafile, sizeof(datafile), "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
|
||||
if ( (data=fopen(datafile, mode)) == NULL )
|
||||
return(NULL);
|
||||
return(data);
|
||||
diff -ur Maelstrom-3.0.6-orig/dialog.h Maelstrom-3.0.6/dialog.h
|
||||
--- Maelstrom-3.0.6-orig/dialog.h 2001-07-21 00:08:10 +0900
|
||||
+++ Maelstrom-3.0.6/dialog.h 2003-05-21 11:24:33 +0900
|
||||
@@ -92,7 +92,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
@@ -878,7 +878,7 @@
|
||||
if ( entry->text ) {
|
||||
Fontserv->FreeText(entry->text);
|
||||
}
|
||||
- sprintf(buf, "%d", *entry->variable);
|
||||
+ snprintf(buf, sizeof(buf), "%d", *entry->variable);
|
||||
|
||||
if ( entry->hilite ) {
|
||||
clear = Fg;
|
||||
diff -ur Maelstrom-3.0.6-orig/load.cpp Maelstrom-3.0.6/load.cpp
|
||||
--- Maelstrom-3.0.6-orig/load.cpp 2000-02-15 11:47:39 +0900
|
||||
+++ Maelstrom-3.0.6/load.cpp 2003-05-21 11:26:18 +0900
|
||||
@@ -81,7 +81,7 @@
|
||||
SDL_Surface *bmp, *title;
|
||||
|
||||
/* Open the title file -- we know its colormap is our global one */
|
||||
- sprintf(file, "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
|
||||
+ snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
|
||||
bmp = SDL_LoadBMP(path.Path(file));
|
||||
if ( bmp == NULL ) {
|
||||
return(NULL);
|
||||
@@ -103,7 +103,7 @@
|
||||
Uint16 w, h;
|
||||
|
||||
/* Open the cicn sprite file.. */
|
||||
- sprintf(file, "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
|
||||
+ snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
|
||||
if ( (cicn_src=SDL_RWFromFile(path.Path(file), "r")) == NULL ) {
|
||||
error("GetCIcon(%hd): Can't open CICN %s: ",
|
||||
cicn_id, path.Path(file));
|
||||
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_FontServ.h Maelstrom-3.0.6/maclib/Mac_FontServ.h
|
||||
--- Maelstrom-3.0.6-orig/maclib/Mac_FontServ.h 1999-12-03 02:15:33 +0900
|
||||
+++ Maelstrom-3.0.6/maclib/Mac_FontServ.h 2003-05-21 11:28:43 +0900
|
||||
@@ -135,7 +135,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_Resource.h Maelstrom-3.0.6/maclib/Mac_Resource.h
|
||||
--- Maelstrom-3.0.6-orig/maclib/Mac_Resource.h 1999-12-04 03:01:47 +0900
|
||||
+++ Maelstrom-3.0.6/maclib/Mac_Resource.h 2003-05-21 11:28:35 +0900
|
||||
@@ -96,7 +96,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_Sound.h Maelstrom-3.0.6/maclib/Mac_Sound.h
|
||||
--- Maelstrom-3.0.6-orig/maclib/Mac_Sound.h 2002-10-20 11:53:34 +0900
|
||||
+++ Maelstrom-3.0.6/maclib/Mac_Sound.h 2003-05-21 11:28:27 +0900
|
||||
@@ -199,7 +199,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff -ur Maelstrom-3.0.6-orig/maclib/Mac_Wave.h Maelstrom-3.0.6/maclib/Mac_Wave.h
|
||||
--- Maelstrom-3.0.6-orig/maclib/Mac_Wave.h 2000-01-26 01:44:10 +0900
|
||||
+++ Maelstrom-3.0.6/maclib/Mac_Wave.h 2003-05-21 11:28:20 +0900
|
||||
@@ -108,7 +108,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff -ur Maelstrom-3.0.6-orig/maclib/macres.cpp Maelstrom-3.0.6/maclib/macres.cpp
|
||||
--- Maelstrom-3.0.6-orig/maclib/macres.cpp 2000-01-26 01:44:20 +0900
|
||||
+++ Maelstrom-3.0.6/maclib/macres.cpp 2003-05-21 11:30:01 +0900
|
||||
@@ -58,8 +58,8 @@
|
||||
ids[j], res->ResourceName(types[i], ids[j]));
|
||||
if ( argv[2] ) {
|
||||
char path[23];
|
||||
- sprintf(path,"%s/%s:%hu", argv[2],
|
||||
- types[i], ids[j]);
|
||||
+ snprintf(path, sizeof(path), "%s/%s:%hu",
|
||||
+ argv[2], types[i], ids[j]);
|
||||
FILE *output;
|
||||
Mac_ResData *D;
|
||||
if ( (output=fopen(path, "w")) != NULL ) {
|
||||
diff -ur Maelstrom-3.0.6-orig/maclib/snd2wav.cpp Maelstrom-3.0.6/maclib/snd2wav.cpp
|
||||
--- Maelstrom-3.0.6-orig/maclib/snd2wav.cpp 2001-03-28 12:54:50 +0900
|
||||
+++ Maelstrom-3.0.6/maclib/snd2wav.cpp 2003-05-21 11:29:23 +0900
|
||||
@@ -82,7 +82,7 @@
|
||||
continue;
|
||||
}
|
||||
wave.Load(snd, rate);
|
||||
- sprintf(wavname, "snd_%d.wav", ids[i]);
|
||||
+ snprintf(wavname, sizeof(wavname), "snd_%d.wav", ids[i]);
|
||||
wave.Save(wavname);
|
||||
}
|
||||
delete macx;
|
||||
diff -ur Maelstrom-3.0.6-orig/main.cpp Maelstrom-3.0.6/main.cpp
|
||||
--- Maelstrom-3.0.6-orig/main.cpp 2002-10-20 11:53:32 +0900
|
||||
+++ Maelstrom-3.0.6/main.cpp 2003-05-21 11:27:02 +0900
|
||||
@@ -445,7 +445,7 @@
|
||||
DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
|
||||
0x00, 0x00, 0x00);
|
||||
}
|
||||
- sprintf(text, "%d", gSoundLevel);
|
||||
+ snprintf(text, sizeof(text), "%d", gSoundLevel);
|
||||
DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
|
||||
30000>>8, 30000>>8, 0xFF);
|
||||
screen->Update();
|
||||
@@ -547,11 +547,11 @@
|
||||
}
|
||||
DrawText(xOff+5, botDiv+42+(index*18), hScores[index].name,
|
||||
font, STYLE_BOLD, R, G, B);
|
||||
- sprintf(buffer, "%u", hScores[index].score);
|
||||
+ snprintf(buffer, sizeof(buffer), "%u", hScores[index].score);
|
||||
sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
|
||||
DrawText(sRt-sw, botDiv+42+(index*18), buffer,
|
||||
font, STYLE_BOLD, R, G, B);
|
||||
- sprintf(buffer, "%u", hScores[index].wave);
|
||||
+ snprintf(buffer, sizeof(buffer), "%u", hScores[index].wave);
|
||||
sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
|
||||
DrawText(wRt-sw, botDiv+42+(index*18), buffer,
|
||||
font, STYLE_BOLD, R, G, B);
|
||||
@@ -560,7 +560,7 @@
|
||||
|
||||
DrawText(xOff+5, botDiv+46+(10*18)+3, "Last Score: ",
|
||||
bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
|
||||
- sprintf(buffer, "%d", GetScore());
|
||||
+ snprintf(buffer, sizeof(buffer), "%d", GetScore());
|
||||
sw = fontserv->TextWidth("Last Score: ", bigfont, STYLE_NORM);
|
||||
DrawText(xOff+5+sw, botDiv+46+(index*18)+3, buffer,
|
||||
bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
|
||||
diff -ur Maelstrom-3.0.6-orig/myerror.cpp Maelstrom-3.0.6/myerror.cpp
|
||||
--- Maelstrom-3.0.6-orig/myerror.cpp 1998-07-14 10:50:17 +0900
|
||||
+++ Maelstrom-3.0.6/myerror.cpp 2003-05-21 11:23:33 +0900
|
||||
@@ -16,7 +16,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(mesg, fmt, ap);
|
||||
+ vsnprintf(mesg, sizeof(mesg), fmt, ap);
|
||||
fputs(mesg, stderr);
|
||||
va_end(ap);
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(mesg, fmt, ap);
|
||||
+ vsnprintf(mesg, sizeof(mesg), fmt, ap);
|
||||
fputs(mesg, stdout);
|
||||
va_end(ap);
|
||||
}
|
||||
@@ -37,7 +37,7 @@
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
if ( *msg ) {
|
||||
- sprintf(buffer, "%s: %s\n", msg, strerror(errno));
|
||||
+ snprintf(buffer, sizeof(buffer), "%s: %s\n", msg, strerror(errno));
|
||||
error(buffer);
|
||||
} else
|
||||
error((char *)strerror(errno));
|
||||
diff -ur Maelstrom-3.0.6-orig/netlogic/game.cpp Maelstrom-3.0.6/netlogic/game.cpp
|
||||
--- Maelstrom-3.0.6-orig/netlogic/game.cpp 2001-07-23 11:24:03 +0900
|
||||
+++ Maelstrom-3.0.6/netlogic/game.cpp 2003-05-21 11:33:19 +0900
|
||||
@@ -232,7 +232,7 @@
|
||||
|
||||
lastDisplayed = gDisplayed;
|
||||
screen->FillRect(0, 0, SCREEN_WIDTH, 12, ourBlack);
|
||||
- sprintf(caption,
|
||||
+ snprintf(caption, sizeof(caption),
|
||||
"You are player %d --- displaying player %d",
|
||||
gOurPlayer+1, gDisplayed+1);
|
||||
DrawText(SPRITES_WIDTH, 11, caption, geneva,
|
||||
@@ -357,7 +357,7 @@
|
||||
/* -- Erase old and draw new score */
|
||||
screen->FillRect(45, gStatusLine+1,
|
||||
score_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%d", Score);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%d", Score);
|
||||
score_width = DrawText(45, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -380,7 +380,7 @@
|
||||
if (lastWave != gWave) {
|
||||
screen->FillRect(255, gStatusLine+1,
|
||||
wave_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%d", gWave);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%d", gWave);
|
||||
wave_width = DrawText(255, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -391,7 +391,7 @@
|
||||
if (lastLives != Lives) {
|
||||
screen->FillRect(319, gStatusLine+1,
|
||||
lives_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-3.1d", Lives);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-3.1d", Lives);
|
||||
lives_width = DrawText(319, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -402,7 +402,7 @@
|
||||
if (lastBonus != Bonus) {
|
||||
screen->FillRect(384, gStatusLine+1,
|
||||
bonus_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-7.1d", Bonus);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-7.1d", Bonus);
|
||||
bonus_width = DrawText(384, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -414,7 +414,7 @@
|
||||
if (lastFrags != Frags) {
|
||||
screen->FillRect(fragoff, gStatusLine+1,
|
||||
frags_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-3.1d", Frags);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-3.1d", Frags);
|
||||
frags_width = DrawText(fragoff, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -747,10 +747,11 @@
|
||||
for ( i=0; i<gNumPlayers; ++i ) {
|
||||
char buffer[BUFSIZ], num1[12], num2[12];
|
||||
|
||||
- sprintf(num1, "%7.1d", final[i].Score);
|
||||
- sprintf(num2, "%3.1d", final[i].Frags);
|
||||
- sprintf(buffer, "Player %d: %-.7s Points, %-.3s Frags",
|
||||
- final[i].Player, num1, num2);
|
||||
+ snprintf(num1, sizeof(num1), "%7.1d", final[i].Score);
|
||||
+ snprintf(num2, sizeof(num2), "%3.1d", final[i].Frags);
|
||||
+ snprintf(buffer, sizeof(buffer),
|
||||
+ "Player %d: %-.7s Points, %-.3s Frags",
|
||||
+ final[i].Player, num1, num2);
|
||||
DrawText(160, 380+i*newyork_height, buffer,
|
||||
newyork, STYLE_NORM, 30000>>8, 30000>>8, 0xFF);
|
||||
}
|
||||
@@ -898,7 +899,7 @@
|
||||
|
||||
|
||||
/* -- Draw the wave completed message */
|
||||
- sprintf(numbuf, "Wave %d completed.", gWave);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "Wave %d completed.", gWave);
|
||||
sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
|
||||
x = (SCREEN_WIDTH - sw) / 2;
|
||||
DrawText(x, 150, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
|
||||
@@ -935,7 +936,7 @@
|
||||
if (OurShip->GetBonusMult() != 1) {
|
||||
SDL_Surface *sprite;
|
||||
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
|
||||
DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
x += 75;
|
||||
@@ -951,10 +952,10 @@
|
||||
Delay(SOUND_DELAY);
|
||||
sound->PlaySound(gFunk, 5);
|
||||
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
|
||||
bonus_width = DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetScore());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
|
||||
score_width = DrawText(xt, 220, numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
screen->Update();
|
||||
@@ -997,12 +998,12 @@
|
||||
|
||||
screen->FillRect(x, 200-text_height+2,
|
||||
bonus_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
|
||||
bonus_width = DrawText(x, 200, numbuf,
|
||||
geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
|
||||
screen->FillRect(xt, 220-text_height+2,
|
||||
score_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetScore());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
|
||||
score_width = DrawText(xt, 220, numbuf,
|
||||
geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
|
||||
|
||||
@@ -1015,7 +1016,7 @@
|
||||
HandleEvents(10);
|
||||
|
||||
/* -- Draw the "next wave" message */
|
||||
- sprintf(numbuf, "Prepare for Wave %d...", gWave+1);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "Prepare for Wave %d...", gWave+1);
|
||||
sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
|
||||
x = (SCREEN_WIDTH - sw)/2;
|
||||
DrawText(x, 259, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
|
||||
diff -ur Maelstrom-3.0.6-orig/netlogic/netplay.cpp Maelstrom-3.0.6/netlogic/netplay.cpp
|
||||
--- Maelstrom-3.0.6-orig/netlogic/netplay.cpp 2002-10-20 13:11:52 +0900
|
||||
+++ Maelstrom-3.0.6/netlogic/netplay.cpp 2003-05-21 11:31:43 +0900
|
||||
@@ -670,7 +670,9 @@
|
||||
strcpy(message, "Waiting for players:");
|
||||
for ( i=0; i<gNumPlayers; ++i ) {
|
||||
if ( ! acked[i] )
|
||||
- sprintf(&message[strlen(message)], " %d", i+1);
|
||||
+ snprintf(&message[strlen(message)],
|
||||
+ sizeof(message)-strlen(message),
|
||||
+ " %d", i+1);
|
||||
}
|
||||
Message(message);
|
||||
|
||||
@@ -725,7 +727,7 @@
|
||||
/* Check the player... */
|
||||
if ( (i != gOurPlayer) && (netbuf[1] == gOurPlayer) ) {
|
||||
/* Print message, sleep 3 seconds absolutely */
|
||||
- sprintf(message,
|
||||
+ snprintf(message, sizeof(message),
|
||||
"Error: Another player (%d) thinks they are player 1!\r\n", i+1);
|
||||
ErrorMessage(message);
|
||||
/* Suck up retransmission packets */
|
||||
diff -ur Maelstrom-3.0.6-orig/netscore.cpp Maelstrom-3.0.6/netscore.cpp
|
||||
--- Maelstrom-3.0.6-orig/netscore.cpp 2001-07-23 12:25:17 +0900
|
||||
+++ Maelstrom-3.0.6/netscore.cpp 2003-05-21 11:27:18 +0900
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
/* Send the scores */
|
||||
crc = get_checksum(key, KEY_LEN);
|
||||
- sprintf(netbuf, SCOREFMT, crc, high.name, high.score, high.wave);
|
||||
+ snprintf(netbuf, sizeof(netbuf), SCOREFMT, crc, high.name, high.score, high.wave);
|
||||
SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
|
||||
n = SDLNet_TCP_Recv(remote, netbuf, 1024);
|
||||
if ( n > 0 ) {
|
||||
diff -ur Maelstrom-3.0.6-orig/screenlib/SDL_FrameBuf.cpp Maelstrom-3.0.6/screenlib/SDL_FrameBuf.cpp
|
||||
--- Maelstrom-3.0.6-orig/screenlib/SDL_FrameBuf.cpp 2001-07-23 06:03:13 +0900
|
||||
+++ Maelstrom-3.0.6/screenlib/SDL_FrameBuf.cpp 2003-05-21 11:31:01 +0900
|
||||
@@ -628,7 +628,7 @@
|
||||
|
||||
found = 0;
|
||||
for ( which=0; !found; ++which ) {
|
||||
- sprintf(file, "%s%d.bmp", prefix, which);
|
||||
+ snprintf(file, sizeof(file), "%s%d.bmp", prefix, which);
|
||||
if ( ((fp=fopen(file, "r")) == NULL) &&
|
||||
((fp=fopen(file, "w")) != NULL) ) {
|
||||
found = 1;
|
||||
diff -ur Maelstrom-3.0.6-orig/screenlib/SDL_FrameBuf.h Maelstrom-3.0.6/screenlib/SDL_FrameBuf.h
|
||||
--- Maelstrom-3.0.6-orig/screenlib/SDL_FrameBuf.h 2000-09-25 02:55:39 +0900
|
||||
+++ Maelstrom-3.0.6/screenlib/SDL_FrameBuf.h 2003-05-21 11:27:41 +0900
|
||||
@@ -165,7 +165,7 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/Maelstrom-netd.c 2014-03-18 01:00:28.408099526 -0400
|
||||
+++ b/Maelstrom-netd.c 2014-03-18 01:01:29.892142782 -0400
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
/* Here we go... */
|
||||
|
||||
+#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
+#include <time.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
@@ -9,6 +11,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
+#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -1,4 +1,533 @@
|
||||
From 0480996a4935c9ca94dbfa94f26ee5cc51d77324 Mon Sep 17 00:00:00 2001
|
||||
From f523585b95fdb2cbcecc3a155f6b3755e789ffab Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 18 Sep 2019 19:20:02 +1000
|
||||
Subject: applying patch maelstrom-3.0.6-64bits.patch
|
||||
|
||||
|
||||
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
|
||||
index d1e087f..01bb13a 100644
|
||||
--- a/screenlib/SDL_FrameBuf.cpp
|
||||
+++ b/screenlib/SDL_FrameBuf.cpp
|
||||
@@ -847,10 +847,8 @@ FrameBuf:: AddDirtyRect(SDL_Rect *rect)
|
||||
/* Update the dirty rectangle map with the new list */
|
||||
for ( i=0; i<dirtymaplen; ++i ) {
|
||||
if ( dirtymap[i] != NULL ) {
|
||||
- dirtymap[i] = (SDL_Rect *)(
|
||||
- ((int)dirtymap[i]-(int)updatelist) +
|
||||
- (int)newlist
|
||||
- );
|
||||
+ dirtymap[i] = newlist
|
||||
+ + (dirtymap[i]-updatelist);
|
||||
}
|
||||
}
|
||||
delete[] updatelist;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
From e7dbfee8a7a26a20bb222d13077882af1797afe4 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 18 Sep 2019 19:20:02 +1000
|
||||
Subject: applying patch maelstrom-3.0.6-gcc34.patch
|
||||
|
||||
|
||||
diff --git a/buttonlist.h b/buttonlist.h
|
||||
index 7bb37b3..980213f 100644
|
||||
--- a/buttonlist.h
|
||||
+++ b/buttonlist.h
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
|
||||
void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height,
|
||||
void (*callback)(void)) {
|
||||
- struct button *belem;
|
||||
+ button *belem;
|
||||
|
||||
for ( belem=&button_list; belem->next; belem=belem->next );
|
||||
belem->next = new button;
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
}
|
||||
|
||||
void Activate_Button(Uint16 x, Uint16 y) {
|
||||
- struct button *belem;
|
||||
+ button *belem;
|
||||
|
||||
for ( belem=button_list.next; belem; belem=belem->next ) {
|
||||
if ( (x >= belem->x1) && (x <= belem->x2) &&
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
}
|
||||
|
||||
void Delete_Buttons(void) {
|
||||
- struct button *belem, *btemp;
|
||||
+ button *belem, *btemp;
|
||||
|
||||
for ( belem=button_list.next; belem; ) {
|
||||
btemp = belem;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
From c847365123c9d5183de6b014d6490beced8cb190 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 18 Sep 2019 19:20:02 +1000
|
||||
Subject: applying patch maelstrom-3.0.6-gcc53.patch
|
||||
|
||||
|
||||
diff --git a/Maelstrom-netd.c b/Maelstrom-netd.c
|
||||
index fde5c05..0981ebe 100644
|
||||
--- a/Maelstrom-netd.c
|
||||
+++ b/Maelstrom-netd.c
|
||||
@@ -201,7 +201,7 @@ main(int argc, char *argv[])
|
||||
memset(&serv_addr, 0, sizeof(serv_addr));
|
||||
serv_addr.sin_family = AF_INET;
|
||||
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
- serv_addr.sin_port = htons(NETPLAY_PORT-1);
|
||||
+ serv_addr.sin_port = htons(NETPLAY_PORT - 1);
|
||||
if (bind(netfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
|
||||
perror("Can't bind local address");
|
||||
exit(3);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
From 6ccb9114abdc4d7811699b1fcf5c8ed9d71346cf Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 18 Sep 2019 19:20:02 +1000
|
||||
Subject: applying patch maelstrom-3.0.6-security.patch
|
||||
|
||||
|
||||
diff --git a/controls.cpp b/controls.cpp
|
||||
index a85e78a..f7eab18 100644
|
||||
--- a/controls.cpp
|
||||
+++ b/controls.cpp
|
||||
@@ -83,7 +83,7 @@ static FILE *OpenData(char *mode, char **fname)
|
||||
if ( fname ) {
|
||||
*fname = datafile;
|
||||
}
|
||||
- sprintf(datafile, "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
|
||||
+ snprintf(datafile, sizeof(datafile), "%s"DIR_SEP"%s", home, MAELSTROM_DATA);
|
||||
if ( (data=fopen(datafile, mode)) == NULL )
|
||||
return(NULL);
|
||||
return(data);
|
||||
diff --git a/dialog.h b/dialog.h
|
||||
index d658d5e..48f4792 100644
|
||||
--- a/dialog.h
|
||||
+++ b/dialog.h
|
||||
@@ -92,7 +92,7 @@ protected:
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
@@ -878,7 +878,7 @@ private:
|
||||
if ( entry->text ) {
|
||||
Fontserv->FreeText(entry->text);
|
||||
}
|
||||
- sprintf(buf, "%d", *entry->variable);
|
||||
+ snprintf(buf, sizeof(buf), "%d", *entry->variable);
|
||||
|
||||
if ( entry->hilite ) {
|
||||
clear = Fg;
|
||||
diff --git a/load.cpp b/load.cpp
|
||||
index 50ab0c3..79c01fd 100644
|
||||
--- a/load.cpp
|
||||
+++ b/load.cpp
|
||||
@@ -81,7 +81,7 @@ SDL_Surface *Load_Title(FrameBuf *screen, int title_id)
|
||||
SDL_Surface *bmp, *title;
|
||||
|
||||
/* Open the title file -- we know its colormap is our global one */
|
||||
- sprintf(file, "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
|
||||
+ snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id);
|
||||
bmp = SDL_LoadBMP(path.Path(file));
|
||||
if ( bmp == NULL ) {
|
||||
return(NULL);
|
||||
@@ -103,7 +103,7 @@ SDL_Surface *GetCIcon(FrameBuf *screen, short cicn_id)
|
||||
Uint16 w, h;
|
||||
|
||||
/* Open the cicn sprite file.. */
|
||||
- sprintf(file, "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
|
||||
+ snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id);
|
||||
if ( (cicn_src=SDL_RWFromFile(path.Path(file), "r")) == NULL ) {
|
||||
error("GetCIcon(%hd): Can't open CICN %s: ",
|
||||
cicn_id, path.Path(file));
|
||||
diff --git a/maclib/Mac_FontServ.h b/maclib/Mac_FontServ.h
|
||||
index e919cca..be508c6 100644
|
||||
--- a/maclib/Mac_FontServ.h
|
||||
+++ b/maclib/Mac_FontServ.h
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff --git a/maclib/Mac_Resource.h b/maclib/Mac_Resource.h
|
||||
index 1115b2d..fed5634 100644
|
||||
--- a/maclib/Mac_Resource.h
|
||||
+++ b/maclib/Mac_Resource.h
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff --git a/maclib/Mac_Sound.h b/maclib/Mac_Sound.h
|
||||
index ba3b36d..d50450e 100644
|
||||
--- a/maclib/Mac_Sound.h
|
||||
+++ b/maclib/Mac_Sound.h
|
||||
@@ -199,7 +199,7 @@ printf("Freeing Wave id %hu at hash page %d/%d\n",(upper<<8)|lower,upper,lower);
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff --git a/maclib/Mac_Wave.h b/maclib/Mac_Wave.h
|
||||
index 54b03a2..9f43d8b 100644
|
||||
--- a/maclib/Mac_Wave.h
|
||||
+++ b/maclib/Mac_Wave.h
|
||||
@@ -108,7 +108,7 @@ private:
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
diff --git a/maclib/macres.cpp b/maclib/macres.cpp
|
||||
index 756a9e9..ce52342 100644
|
||||
--- a/maclib/macres.cpp
|
||||
+++ b/maclib/macres.cpp
|
||||
@@ -58,8 +58,8 @@ int main(int argc, char *argv[])
|
||||
ids[j], res->ResourceName(types[i], ids[j]));
|
||||
if ( argv[2] ) {
|
||||
char path[23];
|
||||
- sprintf(path,"%s/%s:%hu", argv[2],
|
||||
- types[i], ids[j]);
|
||||
+ snprintf(path, sizeof(path), "%s/%s:%hu",
|
||||
+ argv[2], types[i], ids[j]);
|
||||
FILE *output;
|
||||
Mac_ResData *D;
|
||||
if ( (output=fopen(path, "w")) != NULL ) {
|
||||
diff --git a/maclib/snd2wav.cpp b/maclib/snd2wav.cpp
|
||||
index 987eb07..06101df 100644
|
||||
--- a/maclib/snd2wav.cpp
|
||||
+++ b/maclib/snd2wav.cpp
|
||||
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
|
||||
continue;
|
||||
}
|
||||
wave.Load(snd, rate);
|
||||
- sprintf(wavname, "snd_%d.wav", ids[i]);
|
||||
+ snprintf(wavname, sizeof(wavname), "snd_%d.wav", ids[i]);
|
||||
wave.Save(wavname);
|
||||
}
|
||||
delete macx;
|
||||
diff --git a/main.cpp b/main.cpp
|
||||
index 7728c0b..69ee31e 100644
|
||||
--- a/main.cpp
|
||||
+++ b/main.cpp
|
||||
@@ -445,7 +445,7 @@ static void DrawSoundLevel(void)
|
||||
DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
|
||||
0x00, 0x00, 0x00);
|
||||
}
|
||||
- sprintf(text, "%d", gSoundLevel);
|
||||
+ snprintf(text, sizeof(text), "%d", gSoundLevel);
|
||||
DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD,
|
||||
30000>>8, 30000>>8, 0xFF);
|
||||
screen->Update();
|
||||
@@ -547,11 +547,11 @@ void DrawMainScreen(void)
|
||||
}
|
||||
DrawText(xOff+5, botDiv+42+(index*18), hScores[index].name,
|
||||
font, STYLE_BOLD, R, G, B);
|
||||
- sprintf(buffer, "%u", hScores[index].score);
|
||||
+ snprintf(buffer, sizeof(buffer), "%u", hScores[index].score);
|
||||
sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
|
||||
DrawText(sRt-sw, botDiv+42+(index*18), buffer,
|
||||
font, STYLE_BOLD, R, G, B);
|
||||
- sprintf(buffer, "%u", hScores[index].wave);
|
||||
+ snprintf(buffer, sizeof(buffer), "%u", hScores[index].wave);
|
||||
sw = fontserv->TextWidth(buffer, font, STYLE_BOLD);
|
||||
DrawText(wRt-sw, botDiv+42+(index*18), buffer,
|
||||
font, STYLE_BOLD, R, G, B);
|
||||
@@ -560,7 +560,7 @@ void DrawMainScreen(void)
|
||||
|
||||
DrawText(xOff+5, botDiv+46+(10*18)+3, "Last Score: ",
|
||||
bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
|
||||
- sprintf(buffer, "%d", GetScore());
|
||||
+ snprintf(buffer, sizeof(buffer), "%d", GetScore());
|
||||
sw = fontserv->TextWidth("Last Score: ", bigfont, STYLE_NORM);
|
||||
DrawText(xOff+5+sw, botDiv+46+(index*18)+3, buffer,
|
||||
bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF);
|
||||
diff --git a/myerror.cpp b/myerror.cpp
|
||||
index 83bf1f8..2cb6a71 100644
|
||||
--- a/myerror.cpp
|
||||
+++ b/myerror.cpp
|
||||
@@ -16,7 +16,7 @@ void error(char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(mesg, fmt, ap);
|
||||
+ vsnprintf(mesg, sizeof(mesg), fmt, ap);
|
||||
fputs(mesg, stderr);
|
||||
va_end(ap);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ void mesg(char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(mesg, fmt, ap);
|
||||
+ vsnprintf(mesg, sizeof(mesg), fmt, ap);
|
||||
fputs(mesg, stdout);
|
||||
va_end(ap);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ void myperror(char *msg)
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
if ( *msg ) {
|
||||
- sprintf(buffer, "%s: %s\n", msg, strerror(errno));
|
||||
+ snprintf(buffer, sizeof(buffer), "%s: %s\n", msg, strerror(errno));
|
||||
error(buffer);
|
||||
} else
|
||||
error((char *)strerror(errno));
|
||||
diff --git a/netlogic/game.cpp b/netlogic/game.cpp
|
||||
index 6cc1ff9..bfa39eb 100644
|
||||
--- a/netlogic/game.cpp
|
||||
+++ b/netlogic/game.cpp
|
||||
@@ -232,7 +232,7 @@ void DrawStatus(Bool first, Bool ForceDraw)
|
||||
|
||||
lastDisplayed = gDisplayed;
|
||||
screen->FillRect(0, 0, SCREEN_WIDTH, 12, ourBlack);
|
||||
- sprintf(caption,
|
||||
+ snprintf(caption, sizeof(caption),
|
||||
"You are player %d --- displaying player %d",
|
||||
gOurPlayer+1, gDisplayed+1);
|
||||
DrawText(SPRITES_WIDTH, 11, caption, geneva,
|
||||
@@ -357,7 +357,7 @@ void DrawStatus(Bool first, Bool ForceDraw)
|
||||
/* -- Erase old and draw new score */
|
||||
screen->FillRect(45, gStatusLine+1,
|
||||
score_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%d", Score);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%d", Score);
|
||||
score_width = DrawText(45, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -380,7 +380,7 @@ void DrawStatus(Bool first, Bool ForceDraw)
|
||||
if (lastWave != gWave) {
|
||||
screen->FillRect(255, gStatusLine+1,
|
||||
wave_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%d", gWave);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%d", gWave);
|
||||
wave_width = DrawText(255, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -391,7 +391,7 @@ void DrawStatus(Bool first, Bool ForceDraw)
|
||||
if (lastLives != Lives) {
|
||||
screen->FillRect(319, gStatusLine+1,
|
||||
lives_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-3.1d", Lives);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-3.1d", Lives);
|
||||
lives_width = DrawText(319, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -402,7 +402,7 @@ void DrawStatus(Bool first, Bool ForceDraw)
|
||||
if (lastBonus != Bonus) {
|
||||
screen->FillRect(384, gStatusLine+1,
|
||||
bonus_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-7.1d", Bonus);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-7.1d", Bonus);
|
||||
bonus_width = DrawText(384, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -414,7 +414,7 @@ void DrawStatus(Bool first, Bool ForceDraw)
|
||||
if (lastFrags != Frags) {
|
||||
screen->FillRect(fragoff, gStatusLine+1,
|
||||
frags_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-3.1d", Frags);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-3.1d", Frags);
|
||||
frags_width = DrawText(fragoff, gStatusLine+11,
|
||||
numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
@@ -747,10 +747,11 @@ static void DoGameOver(void)
|
||||
for ( i=0; i<gNumPlayers; ++i ) {
|
||||
char buffer[BUFSIZ], num1[12], num2[12];
|
||||
|
||||
- sprintf(num1, "%7.1d", final[i].Score);
|
||||
- sprintf(num2, "%3.1d", final[i].Frags);
|
||||
- sprintf(buffer, "Player %d: %-.7s Points, %-.3s Frags",
|
||||
- final[i].Player, num1, num2);
|
||||
+ snprintf(num1, sizeof(num1), "%7.1d", final[i].Score);
|
||||
+ snprintf(num2, sizeof(num2), "%3.1d", final[i].Frags);
|
||||
+ snprintf(buffer, sizeof(buffer),
|
||||
+ "Player %d: %-.7s Points, %-.3s Frags",
|
||||
+ final[i].Player, num1, num2);
|
||||
DrawText(160, 380+i*newyork_height, buffer,
|
||||
newyork, STYLE_NORM, 30000>>8, 30000>>8, 0xFF);
|
||||
}
|
||||
@@ -898,7 +899,7 @@ static void DoBonus(void)
|
||||
|
||||
|
||||
/* -- Draw the wave completed message */
|
||||
- sprintf(numbuf, "Wave %d completed.", gWave);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "Wave %d completed.", gWave);
|
||||
sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
|
||||
x = (SCREEN_WIDTH - sw) / 2;
|
||||
DrawText(x, 150, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
|
||||
@@ -935,7 +936,7 @@ static void DoBonus(void)
|
||||
if (OurShip->GetBonusMult() != 1) {
|
||||
SDL_Surface *sprite;
|
||||
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
|
||||
DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
x += 75;
|
||||
@@ -951,10 +952,10 @@ static void DoBonus(void)
|
||||
Delay(SOUND_DELAY);
|
||||
sound->PlaySound(gFunk, 5);
|
||||
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
|
||||
bonus_width = DrawText(x, 200, numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetScore());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
|
||||
score_width = DrawText(xt, 220, numbuf, geneva, STYLE_BOLD,
|
||||
0xFF, 0xFF, 0xFF);
|
||||
screen->Update();
|
||||
@@ -997,12 +998,12 @@ static void DoBonus(void)
|
||||
|
||||
screen->FillRect(x, 200-text_height+2,
|
||||
bonus_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetBonus());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus());
|
||||
bonus_width = DrawText(x, 200, numbuf,
|
||||
geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
|
||||
screen->FillRect(xt, 220-text_height+2,
|
||||
score_width, text_height, ourBlack);
|
||||
- sprintf(numbuf, "%-5.1d", OurShip->GetScore());
|
||||
+ snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore());
|
||||
score_width = DrawText(xt, 220, numbuf,
|
||||
geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF);
|
||||
|
||||
@@ -1015,7 +1016,7 @@ static void DoBonus(void)
|
||||
HandleEvents(10);
|
||||
|
||||
/* -- Draw the "next wave" message */
|
||||
- sprintf(numbuf, "Prepare for Wave %d...", gWave+1);
|
||||
+ snprintf(numbuf, sizeof(numbuf), "Prepare for Wave %d...", gWave+1);
|
||||
sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD);
|
||||
x = (SCREEN_WIDTH - sw)/2;
|
||||
DrawText(x, 259, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00);
|
||||
diff --git a/netlogic/netplay.cpp b/netlogic/netplay.cpp
|
||||
index 6c4dc1e..30eb55f 100644
|
||||
--- a/netlogic/netplay.cpp
|
||||
+++ b/netlogic/netplay.cpp
|
||||
@@ -670,7 +670,9 @@ int Send_NewGame(int *Wave, int *Lives, int *Turbo)
|
||||
strcpy(message, "Waiting for players:");
|
||||
for ( i=0; i<gNumPlayers; ++i ) {
|
||||
if ( ! acked[i] )
|
||||
- sprintf(&message[strlen(message)], " %d", i+1);
|
||||
+ snprintf(&message[strlen(message)],
|
||||
+ sizeof(message)-strlen(message),
|
||||
+ " %d", i+1);
|
||||
}
|
||||
Message(message);
|
||||
|
||||
@@ -725,7 +727,7 @@ int Send_NewGame(int *Wave, int *Lives, int *Turbo)
|
||||
/* Check the player... */
|
||||
if ( (i != gOurPlayer) && (netbuf[1] == gOurPlayer) ) {
|
||||
/* Print message, sleep 3 seconds absolutely */
|
||||
- sprintf(message,
|
||||
+ snprintf(message, sizeof(message),
|
||||
"Error: Another player (%d) thinks they are player 1!\r\n", i+1);
|
||||
ErrorMessage(message);
|
||||
/* Suck up retransmission packets */
|
||||
diff --git a/netscore.cpp b/netscore.cpp
|
||||
index 27c2713..3cfc71c 100644
|
||||
--- a/netscore.cpp
|
||||
+++ b/netscore.cpp
|
||||
@@ -59,7 +59,7 @@ void RegisterHighScore(Scores high)
|
||||
|
||||
/* Send the scores */
|
||||
crc = get_checksum(key, KEY_LEN);
|
||||
- sprintf(netbuf, SCOREFMT, crc, high.name, high.score, high.wave);
|
||||
+ snprintf(netbuf, sizeof(netbuf), SCOREFMT, crc, high.name, high.score, high.wave);
|
||||
SDLNet_TCP_Send(remote, netbuf, strlen(netbuf));
|
||||
n = SDLNet_TCP_Recv(remote, netbuf, 1024);
|
||||
if ( n > 0 ) {
|
||||
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
|
||||
index 01bb13a..3ce33d2 100644
|
||||
--- a/screenlib/SDL_FrameBuf.cpp
|
||||
+++ b/screenlib/SDL_FrameBuf.cpp
|
||||
@@ -628,7 +628,7 @@ FrameBuf:: ScreenDump(char *prefix, Uint16 x, Uint16 y, Uint16 w, Uint16 h)
|
||||
|
||||
found = 0;
|
||||
for ( which=0; !found; ++which ) {
|
||||
- sprintf(file, "%s%d.bmp", prefix, which);
|
||||
+ snprintf(file, sizeof(file), "%s%d.bmp", prefix, which);
|
||||
if ( ((fp=fopen(file, "r")) == NULL) &&
|
||||
((fp=fopen(file, "w")) != NULL) ) {
|
||||
found = 1;
|
||||
diff --git a/screenlib/SDL_FrameBuf.h b/screenlib/SDL_FrameBuf.h
|
||||
index 1957c81..cb53085 100644
|
||||
--- a/screenlib/SDL_FrameBuf.h
|
||||
+++ b/screenlib/SDL_FrameBuf.h
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
- vsprintf(errbuf, fmt, ap);
|
||||
+ vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
|
||||
va_end(ap);
|
||||
errstr = errbuf;
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
From cdf04bd50e54c382eae96f1d8f9711e7aacbe0a2 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 18 Sep 2019 19:20:02 +1000
|
||||
Subject: applying patch maelstrom-3.0.6-warnings.patch
|
||||
|
||||
|
||||
diff --git a/Maelstrom-netd.c b/Maelstrom-netd.c
|
||||
index 0981ebe..afc409c 100644
|
||||
--- a/Maelstrom-netd.c
|
||||
+++ b/Maelstrom-netd.c
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
/* Here we go... */
|
||||
|
||||
+#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
+#include <time.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
@@ -9,6 +11,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
+#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
From 6fb3dc44dd2a5af83d81abee0bb9db9d40cb6158 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 12 Jan 2014 13:27:13 +0100
|
||||
Subject: Add haiku support to configure script.
|
||||
@@ -20,37 +549,10 @@ index 0170f4b..4f99f3f 100644
|
||||
MATHLIB=""
|
||||
INETLIB=""
|
||||
--
|
||||
2.21.0
|
||||
2.23.0
|
||||
|
||||
|
||||
From 9bfb5d370173ffe6eb641b6d077e42aa0b4b7c17 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Reznikov <diver@gelios.net>
|
||||
Date: Wed, 5 Dec 2018 14:00:48 +0300
|
||||
Subject: Fix build on x86_64
|
||||
|
||||
|
||||
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
|
||||
index d1e087f..01bb13a 100644
|
||||
--- a/screenlib/SDL_FrameBuf.cpp
|
||||
+++ b/screenlib/SDL_FrameBuf.cpp
|
||||
@@ -847,10 +847,8 @@ FrameBuf:: AddDirtyRect(SDL_Rect *rect)
|
||||
/* Update the dirty rectangle map with the new list */
|
||||
for ( i=0; i<dirtymaplen; ++i ) {
|
||||
if ( dirtymap[i] != NULL ) {
|
||||
- dirtymap[i] = (SDL_Rect *)(
|
||||
- ((int)dirtymap[i]-(int)updatelist) +
|
||||
- (int)newlist
|
||||
- );
|
||||
+ dirtymap[i] = newlist
|
||||
+ + (dirtymap[i]-updatelist);
|
||||
}
|
||||
}
|
||||
delete[] updatelist;
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From fe0aa7eef21afd8c95e33514ae873125eb904114 Mon Sep 17 00:00:00 2001
|
||||
From 36daf3d5258e31f4850273e52ca6b9dc15bc2044 Mon Sep 17 00:00:00 2001
|
||||
From: begasus <begasus@gmail.com>
|
||||
Date: Mon, 8 Jul 2019 21:44:51 +0200
|
||||
Subject: Fix install path
|
||||
@@ -72,5 +574,32 @@ index 4f99f3f..b7e4942 100644
|
||||
GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
|
||||
;;
|
||||
--
|
||||
2.21.0
|
||||
2.23.0
|
||||
|
||||
|
||||
From 7cb40b66613a6e1ffaf02cbc903617b5b3255259 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 18 Sep 2019 20:02:29 +1000
|
||||
Subject: Set realpath for binary
|
||||
|
||||
|
||||
diff --git a/main.cpp b/main.cpp
|
||||
index 69ee31e..78b4168 100644
|
||||
--- a/main.cpp
|
||||
+++ b/main.cpp
|
||||
@@ -174,6 +174,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Normal variables */
|
||||
SDL_Event event;
|
||||
+#ifdef __HAIKU__
|
||||
+ char *binpath = realpath(argv[0], NULL);
|
||||
+ if (binpath != NULL)
|
||||
+ argv[0] = binpath;
|
||||
+#endif
|
||||
+
|
||||
LibPath::SetExePath(argv[0]);
|
||||
|
||||
#ifndef __WIN95__
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user