printsock: quote network interface names

* net.c (printsock): Print network interface names returned by
if_indextoname() using print_quoted_string.
This commit is contained in:
Дмитрий Левин 2015-01-24 20:23:02 +00:00
parent c92977118d
commit 0e9d594caa

9
net.c
View File

@ -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++;