From aad9327bd42fed7bf5a2b31384ddf83be1294254 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Tue, 4 Aug 2015 11:39:49 -0400 Subject: [PATCH] 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. --- srogue/monsters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srogue/monsters.c b/srogue/monsters.c index cd63f7b..1458274 100644 --- a/srogue/monsters.c +++ b/srogue/monsters.c @@ -193,7 +193,7 @@ char type; */ wanderer() { - reg int ch; + reg int ch = '-'; reg struct room *rp, *hr = player.t_room; reg struct linked_list *item; reg struct thing *tp;