]> granicus.if.org Git - nethack/commitdiff
debug tweak
authorPatR <rankin@nethack.org>
Mon, 4 Sep 2017 22:19:37 +0000 (15:19 -0700)
committerPatR <rankin@nethack.org>
Mon, 4 Sep 2017 22:19:37 +0000 (15:19 -0700)
Theoretically we still support implementations which don't have %p.
Even if we didn't, it requires a 'void *' argument rather than an
arbitrary pointer, so casts would have been needed.

src/eat.c

index 9a8e333f5f97f30a71f4a48609a31fbc58e67890..c5f7c2c6d0de9484c25f06ec2624ca3805fbd4f5 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1708,7 +1708,12 @@ struct obj *otmp;
 {
     const char *old_nomovemsg, *save_nomovemsg;
 
-    debugpline2("start_eating: %p (victual = %p)", otmp, context.victual.piece);
+    debugpline2("start_eating: %s (victual = %s)",
+                /* note: fmt_ptr() returns a static buffer but supports
+                   several such so we don't need to copy the first result
+                   before calling it a second time */
+                fmt_ptr((genericptr_t) otmp),
+                fmt_ptr((genericptr_t) context.victual.piece));
     debugpline1("reqtime = %d", context.victual.reqtime);
     debugpline1("(original reqtime = %d)", objects[otmp->otyp].oc_delay);
     debugpline1("nmod = %d", context.victual.nmod);