From: Eugene Syromyatnikov Date: Sun, 1 Jan 2017 18:13:07 +0000 (+0300) Subject: loop: fix printing of the reserved field array items X-Git-Tag: v4.16~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ba63db908e5aef711e6b4261e00d1cef5a912e3;p=strace loop: fix printing of the reserved field array items They are of char type, so "hh" length modifier should be used (otherwise they are printed incorrectly as they are sign extended implicitly when passed as printf arguments in case char is a signed type which is true for most compilers). * loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx" in printing routine for array elements of the "reserved" field of loop_info structure. --- diff --git a/loop.c b/loop.c index 2ade8e7a..e43fcaad 100644 --- a/loop.c +++ b/loop.c @@ -82,7 +82,7 @@ decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr) if (!abbrev(tcp)) tprintf(", lo_init=[%#" PRI_klx ", %#" PRI_klx "]" - ", reserved=[%#x, %#x, %#x, %#x]}", + ", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}", (kernel_ulong_t) info.lo_init[0], (kernel_ulong_t) info.lo_init[1], info.reserved[0], info.reserved[1],