]> granicus.if.org Git - strace/commitdiff
Print NULL for zero address in sys_mmap64
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 3 Feb 2012 18:07:42 +0000 (10:07 -0800)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 6 Feb 2012 13:33:41 +0000 (13:33 +0000)
* mem.c (sys_mmap64): Print NULL for zero address so that it is
consistent with sys_mmap.

mem.c

diff --git a/mem.c b/mem.c
index e440e9ff33546b48a7cc87e60c16b91ea11c657a..7fdd384eeaba69e6ad87d8d2a9cf586d00cfee1c 100644 (file)
--- a/mem.c
+++ b/mem.c
@@ -352,7 +352,10 @@ sys_mmap64(struct tcb *tcp)
                        return 0;
 #endif
                /* addr */
-               tprintf("%#lx, ", u_arg[0]);
+               if (!u_arg[0])
+                       tprints("NULL, ");
+               else
+                       tprintf("%#lx, ", u_arg[0]);
                /* len */
                tprintf("%lu, ", u_arg[1]);
                /* prot */