early-roguelike/rogue5
John "Elwin" Edwards 082cd54126 Fix some terribly depressing corruption during restore.
In rogue5/state.c, rs_read_daemons() zeroes out the argument and delay
if the daemon slot is empty.  Unfortunately that code ended up on the
wrong side of the brace that closes the for loop, so instead of running
after each daemon, it got run once after the loop exited, when the
index was of course out of bounds.

This tended to manifest, when compiled with -O2, by overwriting hw and
setting it to NULL.  When inventory() next ran, hw would be passed to
wgetch(), which returns ERR when it gets a NULL argument.  This made
md_readchar() think something was wrong and autosave the game.

Upon investigation, rogue3 was found to commit the same mistake.
rogue4 and srogue don't zero the data.  arogue5 already does it
properly.

Someday I am going to run all this through Valgrind.  Someday when I
am a kinder person who will not be driven to invoke hordes of trolls
and centaurs upon the original authors.
2014-01-08 16:44:16 -05:00
..
.svnignore Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
acinclude.m4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
armor.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
chase.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
command.c Don't set the player's ISRUN flag. 2013-08-13 09:19:56 -07:00
config.guess Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
config.sub Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
configure.ac Don't set DESTDIR via configure. 2013-08-26 19:58:44 -07:00
daemon.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
daemons.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
extern.c rogue5: add savedir, logfile, bugfixes 2010-05-24 20:16:15 +00:00
extern.h rogue5: add savedir, logfile, bugfixes 2010-05-24 20:16:15 +00:00
fight.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
findpw.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
init.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
install-sh Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
io.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
LICENSE.TXT Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
list.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
mach_dep.c rogue5: add savedir, logfile, bugfixes 2010-05-24 20:16:15 +00:00
main.c Make sure the score list appears in all situations. 2010-12-07 16:46:07 +00:00
Makefile.in Add config.h to the list of headers in the Makefiles. 2013-09-03 14:14:48 -07:00
Makefile.std Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
mdport.c rogue[345]: fix backspace key in prompts. 2013-08-27 09:25:30 -07:00
misc.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
monsters.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
move.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
new_level.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
options.c rogue5: add savedir, logfile, bugfixes 2010-05-24 20:16:15 +00:00
pack.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
passages.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
potions.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rings.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rip.c Make sure the score list appears in all situations. 2010-12-07 16:46:07 +00:00
rogue.6.in Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.cat.in Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.desktop Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.doc.in Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.h rogue5: add savedir, logfile, bugfixes 2010-05-24 20:16:15 +00:00
rogue.html.in Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.me.in Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.png Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue.spec Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue54.sln Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rogue54.vcproj Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
rooms.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
save.c rogue5: Clear encerror so scoreboard writing works. 2011-10-07 06:15:48 +00:00
scedit.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
scmisc.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
score.h Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
scrolls.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
state.c Fix some terribly depressing corruption during restore. 2014-01-08 16:44:16 -05:00
sticks.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
things.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
vers.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
weapons.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
wizard.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00
xcrypt.c Import Rogue 5.4 from the Roguelike Restoration Project (r1490) 2010-05-24 20:10:59 +00:00