aboutsummaryrefslogtreecommitdiff
path: root/games/freebsd-games/files/patch-rogue::inventory.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/freebsd-games/files/patch-rogue::inventory.c')
-rw-r--r--games/freebsd-games/files/patch-rogue::inventory.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/games/freebsd-games/files/patch-rogue::inventory.c b/games/freebsd-games/files/patch-rogue::inventory.c
new file mode 100644
index 000000000000..c76aed803225
--- /dev/null
+++ b/games/freebsd-games/files/patch-rogue::inventory.c
@@ -0,0 +1,23 @@
+$FreeBSD$
+
+--- rogue/inventory.c 30 Nov 1999 03:49:23 -0000 1.4
++++ rogue/inventory.c 21 Aug 2003 19:58:45 -0000
+@@ -415,14 +415,14 @@
+ mix_colors()
+ {
+ short i, j, k;
+- char *t;
++ char t[MAX_ID_TITLE_LEN];
+
+ for (i = 0; i <= 32; i++) {
+ j = get_rand(0, (POTIONS - 1));
+ k = get_rand(0, (POTIONS - 1));
+- t = id_potions[j].title;
+- id_potions[j].title = id_potions[k].title;
+- id_potions[k].title = t;
++ memcpy(t, id_potions[j].title, MAX_ID_TITLE_LEN);
++ memcpy(id_potions[j].title, id_potions[k].title, MAX_ID_TITLE_LEN);
++ memcpy(id_potions[k].title, t, MAX_ID_TITLE_LEN);
+ }
+ }
+