Skip to content

Commit

Permalink
games-board/gnugo: Drop games.eclass, format-security fix (#544362)
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.31, Repoman-2.3.9
  • Loading branch information
pacho2 committed Apr 29, 2018
1 parent c436cb5 commit 6deeb13
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
60 changes: 60 additions & 0 deletions games-board/gnugo/files/gnugo-3.9.1-format-security.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
diff --git a/patterns/dfa.c b/patterns/dfa.c
index 3689616..2d2f8c6 100644
--- a/patterns/dfa.c
+++ b/patterns/dfa.c
@@ -279,7 +279,7 @@ resize_dfa(dfa_t *pdfa, int max_states, int max_indexes)
* dump a dfa (debugging purpose).
*/

-static const char *line =
+static const char line[] =
"----------------------------------------------------\n";

void
diff --git a/patterns/mkpat.c b/patterns/mkpat.c
index 70a6964..5f1f1dd 100644
--- a/patterns/mkpat.c
+++ b/patterns/mkpat.c
@@ -1419,7 +1419,7 @@ generate_autohelper_code(int funcno, int number_of_params, int *labels)
/* A common case. Just use the labels as parameters. */
switch (number_of_params) {
case 0:
- code_pos += sprintf(code_pos, autohelper_functions[funcno].code);
+ code_pos += sprintf(code_pos, "%s", autohelper_functions[funcno].code);
break;
case 1:
code_pos += sprintf(code_pos, autohelper_functions[funcno].code,
diff --git a/patterns/uncompress_fuseki.c b/patterns/uncompress_fuseki.c
index 3290b05..c67a733 100644
--- a/patterns/uncompress_fuseki.c
+++ b/patterns/uncompress_fuseki.c
@@ -224,9 +224,9 @@ main(int argc, char *argv[])

assert(boardsize > 0);
if (boardsize > MAX_BOARD) {
- printf(output_strings[PREAMBLE]);
+ printf("%s", output_strings[PREAMBLE]);
printf(output_strings[HEADER], boardsize);
- printf(output_strings[FOOTER]);
+ printf("%s", output_strings[FOOTER]);
return EXIT_SUCCESS;
}

@@ -251,7 +251,7 @@ main(int argc, char *argv[])
board[k][boardsize + 1] = '|';
}

- printf(output_strings[PREAMBLE]);
+ printf("%s", output_strings[PREAMBLE]);
printf(output_strings[HEADER], boardsize);


@@ -308,7 +308,7 @@ main(int argc, char *argv[])
if (mode == C_OUTPUT)
write_pattern_c_code(NULL, board1d, NO_MOVE, 0, boardsize, -1);

- printf(output_strings[FOOTER]);
+ printf("%s", output_strings[FOOTER]);

return EXIT_SUCCESS;
}
30 changes: 30 additions & 0 deletions games-board/gnugo/gnugo-3.9.1-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="A Go-playing program"
HOMEPAGE="https://www.gnu.org/software/gnugo/devel.html"
SRC_URI="mirror://gentoo/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="readline"

RDEPEND="
readline? ( sys-libs/readline:0= )
>=sys-libs/ncurses-5.2-r3:0=
"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}"/${P}-invalid-move.patch
"${FILESDIR}"/${P}-format-security.patch
)

src_configure() {
econf \
$(use_with readline) \
--enable-cache-size=32
}

0 comments on commit 6deeb13

Please sign in to comment.