Print hexadecimal integer in error diagnostics using %#x
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 7 Jan 2017 16:44:44 +0000 (16:44 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 7 Jan 2017 16:44:44 +0000 (16:44 +0000)
The formerly used format string %x led to misleading output as there was
no clear indication sometimes whether the printed integer was decimal or
hexadecimal.

* aio.c (startup_child, test_ptrace_seize): Print status
using %#x format specifier instead of %x.

strace.c

index a337362e52916e0ce79f5759d6cf3a1df85e96e8..653009b5a3880c78b9b74983f264dd0cec1dd894 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -1409,7 +1409,8 @@ startup_child(char **argv)
                                }
                                if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) {
                                        kill_save_errno(pid, SIGKILL);
-                                       perror_msg_and_die("Unexpected wait status %x", status);
+                                       perror_msg_and_die("Unexpected wait status %#x",
+                                                          status);
                                }
                        }
                        /* Else: NOMMU case, we have no way to sync.
@@ -1522,8 +1523,8 @@ test_ptrace_seize(void)
                if (WIFSIGNALED(status)) {
                        return;
                }
-               error_msg_and_die("%s: unexpected wait status %x",
-                               __func__, status);
+               error_msg_and_die("%s: unexpected wait status %#x",
+                                 __func__, status);
        }
 }
 #else /* !USE_SEIZE */