From 8192cece19f4f3002958e851ece6b70e836b02e6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 24 Jan 2015 22:33:55 +0000 Subject: [PATCH] mips: quote sysmips nodename * sysmips.c (sys_sysmips): Print nodename using print_quoted_string. --- sysmips.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sysmips.c b/sysmips.c index 521b0816..6728b8a7 100644 --- a/sysmips.c +++ b/sysmips.c @@ -23,10 +23,14 @@ int sys_sysmips(struct tcb *tcp) tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); } else if (tcp->u_arg[0] == SETNAME) { char nodename[__NEW_UTS_LEN + 1]; - if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0) - tprintf(", %#lx", tcp->u_arg[1]); - else - tprintf(", \"%.*s\"", (int)(__NEW_UTS_LEN + 1), nodename); + tprints(", "); + if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), + nodename) < 0) { + tprintf("%#lx", tcp->u_arg[1]); + } else { + print_quoted_string(nodename, __NEW_UTS_LEN + 1, + QUOTE_0_TERMINATED); + } } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) { tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); } else if (tcp->u_arg[0] == MIPS_FIXADE) { -- 2.40.0