changeset 177:7bdac632ab9d

srogue: fix an uninitialized variable. In wanderer(), if rp == hr, the loop could test ch before its value has been set. Initializing ch to '-' now causes the loop to repeat until a location is found.
author John "Elwin" Edwards
date Tue, 04 Aug 2015 11:39:49 -0400
parents db1c9a21a7c3
children f057f09e9945 533f1882dcb6
files srogue/monsters.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/srogue/monsters.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/srogue/monsters.c	Tue Aug 04 11:39:49 2015 -0400
@@ -193,7 +193,7 @@
  */
 wanderer()
 {
-	reg int ch;
+	reg int ch = '-';
 	reg struct room *rp, *hr = player.t_room;
 	reg struct linked_list *item;
 	reg struct thing *tp;