fmt_ptr (trunk only)

fmt_ptr() is no longer dependant on WIZARD or MONITOR_HEAP,
so that it can be used in panic messages.
This commit is contained in:
nethack.allison
2006-07-02 18:43:35 +00:00
parent 13eeae9523
commit 3d164b6d02
6 changed files with 23 additions and 28 deletions

View File

@@ -482,9 +482,9 @@ monsndx(ptr) /* return an index into the mons array */
i = (int)(ptr - &mons[0]);
if (i < LOW_PM || i >= NUMMONS) {
/* ought to switch this to use `fmt_ptr' */
panic("monsndx - could not index monster (%lx)",
(unsigned long)ptr);
char ptr_address[FMT_PTR_BUFSIZ];
panic("monsndx - could not index monster (%s)",
fmt_ptr((genericptr_t)ptr, ptr_address));
return NON_PM; /* will not get here */
}