From 8be873747a6e28286ac7c52900ea37f0c2fae272 Mon Sep 17 00:00:00 2001 From: marcel Date: Sat, 28 Jul 2007 23:18:39 +0000 Subject: [PATCH] Print integer-typed arguments as integers. This makes sure that on 64-bit platforms the result is more reliable. For example, -1 was previously printed as 0xffffffff. Approved by: re (kensmith) --- usr.bin/truss/syscalls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 0a8ac6b13a97..642c29f14ea5 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -496,13 +496,13 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval, struct trus int pid = trussinfo->pid; switch (sc->type & ARG_MASK) { case Hex: - asprintf(&tmp, "0x%lx", args[sc->offset]); + asprintf(&tmp, "0x%x", (int)args[sc->offset]); break; case Octal: - asprintf(&tmp, "0%lo", args[sc->offset]); + asprintf(&tmp, "0%o", (int)args[sc->offset]); break; case Int: - asprintf(&tmp, "%ld", args[sc->offset]); + asprintf(&tmp, "%d", (int)args[sc->offset]); break; case Name: {