From 53a6ded473da321c32ef59c61cd822cf9de527d0 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 8 Apr 1987 15:10:26 +0000 Subject: [PATCH] fix; %ld is not proper for an int --- util/amisc/ashow.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/util/amisc/ashow.c b/util/amisc/ashow.c index 09d67b215..2a29371dc 100644 --- a/util/amisc/ashow.c +++ b/util/amisc/ashow.c @@ -71,11 +71,15 @@ show(headp) */ name = (struct outname *) myalloc(headp->oh_nname * SZ_NAME); string = myalloc((unsigned) headp->oh_nchar); + rd_name(name, headp->oh_nname); for (np = &name[0]; np < &name[headp->oh_nname]; np++) { - rd_name(np, 1); - if (np->on_foff != 0) - np->on_mptr = string + np->on_foff - OFF_CHAR(*headp); -/* Weird: ^^^^^^^^^^^^^^^^^^^ */ + if (np->on_foff != 0) { + np->on_foff -= OFF_CHAR(*headp); + if (np->on_foff >= headp->oh_nchar || np->on_foff < 0) { + np->on_mptr = "????"; + } + else np->on_mptr = string + np->on_foff; + } } /* * Transfer strings from file to core. @@ -162,7 +166,7 @@ showname(namep) printf("\tabsolute\n"); break; default: - printf("\tin section %ld\n", (namep->on_type & S_TYP) - S_MIN); + printf("\tin section %d\n", (namep->on_type & S_TYP) - S_MIN); break; } if (namep->on_type & S_EXT) printf("\texternal\n"); -- 2.34.1