For the POSIX regexp interface, move local declaration to beginning of block to avoid requiring C99. Also switch to alloc() from bare malloc() so that MONITOR_HEAP won't log a free which doesn't match up to any allocation. This results in a change in behavior: if the allocation fails, nethack will panic rather than report an option parsing error. In practice there will be no difference because nethack is not going to run out of dynamic memory during initial options processing.
2.8 KiB
2.8 KiB