summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTupone Alfredo <tupone@gentoo.org>2016-01-04 16:01:23 +0100
committerTupone Alfredo <tupone@gentoo.org>2016-01-04 16:02:00 +0100
commitf2c4d6d57a2f38769508dffbc5a5adf86c6ec0b6 (patch)
tree8a72cb078fdc9516388f5cacabd41d898ca909b6 /games-strategy
parentgnome-base/libbonoboui updated homepage (diff)
downloadgentoo-f2c4d6d57a2f38769508dffbc5a5adf86c6ec0b6.tar.gz
gentoo-f2c4d6d57a2f38769508dffbc5a5adf86c6ec0b6.tar.bz2
gentoo-f2c4d6d57a2f38769508dffbc5a5adf86c6ec0b6.zip
games-strategy/galaxyhack: Build with -Wformat-security. Bug #57069
Package-Manager: portage-2.2.24
Diffstat (limited to 'games-strategy')
-rw-r--r--games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch64
-rw-r--r--games-strategy/galaxyhack/galaxyhack-1.74.ebuild3
2 files changed, 66 insertions, 1 deletions
diff --git a/games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch b/games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch
new file mode 100644
index 000000000000..4bd9e8fc6f83
--- /dev/null
+++ b/games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch
@@ -0,0 +1,64 @@
+--- JSDL.cpp.old 2016-01-04 10:42:56.404316856 +0100
++++ JSDL.cpp 2016-01-04 10:51:16.744255312 +0100
+@@ -47,14 +47,14 @@
+ if (!globalSettings.batch) {
+ if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO) == -1) {
+ char output[120];
+- sprintf(output, SDL_GetError());
++ strcpy(output, SDL_GetError());
+ throw runtime_error(output);
+ }
+
+ if (!globalSettings.disableSound) {
+ if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) {
+ char error[120];
+- sprintf(error, SDL_GetError());
++ strcpy(error, SDL_GetError());
+ string errorStr = error;
+ errorStr += ", continuing without initialising sound.";
+ WriteLog(errorStr);
+@@ -81,7 +81,7 @@
+ //4096 is rather a large chunksize, should be smaller if I add sound effects
+ if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096) == -1) {
+ char output[100];
+- sprintf(output, Mix_GetError());
++ strcpy(output, Mix_GetError());
+ throw runtime_error(output);
+ }
+ }
+@@ -101,7 +101,7 @@
+ if (screen == NULL) {
+ SDL_Quit();
+ char output[120];
+- sprintf(output, SDL_GetError());
++ strcpy(output, SDL_GetError());
+ throw runtime_error(output);
+ }
+ }
+@@ -114,7 +114,7 @@
+
+ if (loadingSurface == NULL) {
+ char output[100];
+- sprintf(output, IMG_GetError());
++ strcpy(output, IMG_GetError());
+ throw runtime_error(output);
+ }
+
+@@ -308,7 +308,7 @@
+
+ if (!theMusic) {
+ char output[100];
+- sprintf(output, Mix_GetError());
++ strcpy(output, Mix_GetError());
+ throw runtime_error(output);
+ }
+ }
+@@ -319,7 +319,7 @@
+
+ if (Mix_PlayMusic(theMusic, -1) == -1) {
+ char output[100];
+- sprintf(output, Mix_GetError());
++ strcpy(output, Mix_GetError());
+ throw runtime_error(output);
+ }
+ }
diff --git a/games-strategy/galaxyhack/galaxyhack-1.74.ebuild b/games-strategy/galaxyhack/galaxyhack-1.74.ebuild
index a85b75536e96..f19966e98676 100644
--- a/games-strategy/galaxyhack/galaxyhack-1.74.ebuild
+++ b/games-strategy/galaxyhack/galaxyhack-1.74.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -30,6 +30,7 @@ src_prepare() {
"${FILESDIR}"/${P}-boost.patch \
"${FILESDIR}"/${P}-gcc43.patch \
"${FILESDIR}"/${P}-boost-1.50.patch \
+ "${FILESDIR}"/${P}-format.patch \
"${FILESDIR}"/${P}-gentoo.patch
sed -i "s:@GAMES_DATADIR@:${GAMES_DATADIR}:" \
Main.cpp || die