summaryrefslogtreecommitdiff
path: root/games/bsdgames/files/patch-rogue::inventory.c
blob: c76aed803225816801ae78b388545285ee9f53d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
 	}
 }