Commit graph

11 commits

Author SHA1 Message Date
John "Elwin" Edwards
3dfd8fd09b Advanced Rogue family: fix some potential buffer overflows.
Some code for determining the score file location assumed that PATH_MAX
would be less than 1024, which cannot be guaranteed.

Advanced Rogue 5 and 7, and XRogue, have had the buffers for the file
name enlarged.  UltraRogue never called the functions, so the code has
been deleted instead.
2021-05-03 19:05:37 -04:00
John "Elwin" Edwards
6c3cd116ff Fix many compiler warnings.
There should only be two changes in behavior:

arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly
applied to characters who are not monks instead of monks who are not
empty-handed.

urogue/fight.c: fixed an interaction with the "debug" macro that could
cause the wrong message to be displayed.
2021-04-14 18:55:33 -04:00
John "Elwin" Edwards
c661fd79d4 Use C stdio functions for score files and save files.
Switching from Unix file descriptor operations to C standard FILE*
functions will reduce portability problems.
2017-09-15 19:57:54 -04:00
John "Elwin" Edwards
7eeb9ddcb6 Add some braces to a loop in parse_opts().
A for loop had no braces around its body, which was a single if-else
statement.  In Advanced Rogue 5, another statement had been added,
accidentally removing the if-else from the loop.  This could have
resulted in an out-of-bounds access to the options array.

In the other games, the added braces are only for clarity.
2017-02-10 09:02:58 -05:00
John "Elwin" Edwards
35bea2ba0d Use uniform return types for functions related to options.
Functions for printing options now return void.  Functions for setting
options now return int.  Argument types still vary, though converting
all the option pointers to void* would be possible.
2016-03-06 14:45:18 -05:00
John "Elwin" Edwards
e8e6e604c3 Advanced Rogue 7: convert to ANSI-style function declarations.
Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
2016-02-19 21:02:28 -05:00
John "Elwin" Edwards
b369d09125 arogue7: fix the backspace key in prompts.
md_readchar() now translates KEY_BACKSPACE to the erase character.

XRogue seems to work already.
2015-05-28 09:41:29 -04:00
John "Elwin" Edwards
e3620a3781 Advanced Rogue family: fix the "score" option.
Changing the score file (when permitted) now works again, closing the
old score file and opening the new one.
2015-05-20 08:42:17 -04:00
John "Elwin" Edwards
b6ab08176a arogue7: prevent changing protected options.
When using the savedir, whoami, file_name, and score_file cannot be
changed.
2015-05-11 19:41:46 -04:00
John "Elwin" Edwards
3095366864 arogue7: add missing header includes. 2015-05-08 16:45:41 -04:00
John "Elwin" Edwards
cf121ade21 Import Advanced Rogue 7.7 from the Roguelike Restoration Project (r1490) 2015-05-08 15:24:40 -04:00