From 0e9d594caa0362d30ab3c39d509da997d051220b Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 24 Jan 2015 20:23:02 +0000 Subject: [PATCH] printsock: quote network interface names * net.c (printsock): Print network interface names returned by if_indextoname() using print_quoted_string. --- net.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net.c b/net.c index ef72d4fe..bba03755 100644 --- a/net.c +++ b/net.c @@ -253,8 +253,13 @@ printsock(struct tcb *tcp, long addr, int addrlen) if (if_indextoname(addrbuf.sa6.sin6_scope_id, scopebuf) == NULL) numericscope++; - else - tprintf(", sin6_scope_id=if_nametoindex(\"%s\")", scopebuf); + else { + tprints(", sin6_scope_id=if_nametoindex("); + print_quoted_string(scopebuf, + sizeof(scopebuf), + QUOTE_0_TERMINATED); + tprints(")"); + } } else numericscope++; -- 2.40.0