# HG changeset patch # User John "Elwin" Edwards # Date 1438702789 14400 # Node ID 7bdac632ab9d4a97c009c0e0f3b0ef40a7ac51da # Parent db1c9a21a7c3164c842abed8ac527562fed748b7 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. diff -r db1c9a21a7c3 -r 7bdac632ab9d srogue/monsters.c --- 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;