Commit graph

14 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
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
62047972cc Use more portable random seed generation.
The new function md_random_seed() has replaced time() + getpid() and
similar methods.  Putting everything in mdport.c slightly reduces the
warnings and workarounds.
2017-01-28 15:49:41 -05:00
John "Elwin" Edwards
758c6b1bf0 arogue7, xrogue: improve the handling of the arguments to fuses.
fuse() now expects a pointer as the argument to a fuse function.  If
this is one of the functions that takes int, fuse() follows the pointer
and stores that value in the f_list slot, in the integer field of the
argument union.  When the fuse goes off, do_fuses() recognizes the
function and passes it the integer field instead of the pointer.

This has the disadvantage of hard-coding the functions that require int
in daemon.c, but since the int is copied into f_list, it no longer has
to be in static or global memory, which simplifies several files.
2016-03-11 17:40:00 -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
4e5f4c52d3 arogue7, xrogue: rename daemon() to start_daemon().
This prevents conflict with the BSD/OSX daemon() system function.
2015-05-28 10:21:43 -04:00
John "Elwin" Edwards
053a248658 arogue7, xrogue: put newlines at the end of startup messages. 2015-05-20 15:15: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
3554339257 Advanced Rogue family: overhaul privilege handling.
Advanced Rogue 5 and 7, and XRogue, now open the scorefile and logfile
at startup and then drop any set[ug]id privileges if the savedir is not
being used.
2015-05-16 13:39:26 -04:00
John "Elwin" Edwards
e8f5429554 arogue7: call nonl() during initialization. 2015-05-12 10:28:05 -04:00
John "Elwin" Edwards
7824f79164 arogue7: implement the -n option. 2015-05-11 16:46:00 -04:00
John "Elwin" Edwards
7da765d616 arogue7: make the scorefile location configurable. 2015-05-11 13:36:36 -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