Commit Graph

15 Commits

Author SHA1 Message Date
pho 9904cea545 hack(6): Fix a segfault that occurs when ASLR is enabled
Prior to this change, savenames() would store "objects" in save files as a
blob, and restnames() would load it and overwrite "objects". But since
objclass::oc_name and oc_descr are pointers to string constants, they would
be invalid when the next time the process is spawned, and opening the
inventory would crash by dereferencing invalid pointers.
2023-07-30 09:23:21 +00:00
dholland 2c0ecb1ab6 Fix up still more casts; use NULL instead of (char *)0. 2011-08-06 20:42:43 +00:00
dholland 8041af98f6 Remove *another* set of useless casts. sheesh 2011-08-06 20:32:25 +00:00
dholland 434d266e91 Use the right type for the malloc wrapper function, and don't cast the
return value.

(XXX: Except for a pile of allocation macros that produce typed pointer
results; there the typechecking of the result assignment is more valuable
than the warning if the alloc function isn't declared properly. These
macros should go away.)
2011-08-06 20:18:26 +00:00
dholland 25ec296591 Remove silly casts. 2011-08-06 20:00:33 +00:00
dholland 9b92b18917 sprinkle static 2009-08-12 07:28:40 +00:00
dholland 1fa8a9a633 ANSIfy function declarations. All object file diffs inspected. 2009-06-07 18:30:39 +00:00
lukem c6144e484f fix -Wsign-compare issues 2009-01-18 00:24:29 +00:00
jsm 1c7f94e505 Hack is now BSD-licensed. Thanks to Andries Brouwer, Jay Fenlason and
CWI <http://www.cwi.nl/~aeb/games/hack/hack.html>.  Via OpenBSD.
Addresses part of PR bin/5850.
2003-04-02 18:36:33 +00:00
jsm ab8b63434d Make mostly gcc -W clean, and other cleanup:
Use const.
Add __noreturn__ attributes.
Add a __format__ attribute.
Add __unused__ attributes.
Use symbolic constants for open() and lseek().
Declare types of all function parameters; convert some function
definitions to ISO C form.
Ensure standard file descriptors are open on startup.
Check for errors writing output of makedefs.
Avoid duplicate definitions of variables.
2001-03-25 20:43:58 +00:00
christos 3ea4a95c18 WARNsify... 1997-10-19 16:56:41 +00:00
cgd c4816c32b3 Various changes to make games compile w/o warnings on the alpha:
Include appropriate includes, delete bogus function declarations,
change sizes of variables and casts.
1995-04-24 12:21:37 +00:00
cgd 42fb1b9d4a merge with Lite, new RCS id conventions, etc. 1995-03-23 08:28:00 +00:00
mycroft 02ded53222 alloc.c 1993-08-02 17:16:36 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00