pointer formatting (trunk only)
Hide pointer formatting in alloc.c by eliminating the need for callers to know how big a buffer is required. I generally prefer the caller to pass in its own buffer for this sort of thing, but in this case the usage is almost entirely for debugging so using static buffers results in less clutter in the rest of the code.
This commit is contained in:
+2
-3
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)mondata.c 3.5 2005/10/05 */
|
||||
/* SCCS Id: @(#)mondata.c 3.5 2006/07/07 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -482,9 +482,8 @@ monsndx(ptr) /* return an index into the mons array */
|
||||
|
||||
i = (int)(ptr - &mons[0]);
|
||||
if (i < LOW_PM || i >= NUMMONS) {
|
||||
char ptr_address[FMT_PTR_BUFSIZ];
|
||||
panic("monsndx - could not index monster (%s)",
|
||||
fmt_ptr((genericptr_t)ptr, ptr_address));
|
||||
fmt_ptr((genericptr_t)ptr));
|
||||
return NON_PM; /* will not get here */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user