summaryrefslogtreecommitdiff
path: root/print-cdp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <fx.lebail@yahoo.com>2015-11-09 15:59:58 +0100
committerFrancois-Xavier Le Bail <fx.lebail@yahoo.com>2015-11-09 16:29:32 +0100
commit4df36ab95d6e23ac109a186c22e2ba60f628c36a (patch)
tree797bba48266919ceb92830003aa51e7b79b397e2 /print-cdp.c
parentef87bed366f45bbb47b0bd7081b1c10a1808ae3d (diff)
downloadtcpdump-4df36ab95d6e23ac109a186c22e2ba60f628c36a.tar.gz
CDP: Filter out non-printable characters
Add a fn_print_char() to do filtering.
Diffstat (limited to 'print-cdp.c')
-rw-r--r--print-cdp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/print-cdp.c b/print-cdp.c
index 96ef143b..cd544ef5 100644
--- a/print-cdp.c
+++ b/print-cdp.c
@@ -169,9 +169,11 @@ cdp_print(netdissect_options *ndo,
ND_PRINT((ndo, "\n\t "));
for (i=0;i<len;i++) {
j = *(tptr+i);
- ND_PRINT((ndo, "%c", j));
- if (j == 0x0a) /* lets rework the version string to get a nice indentation */
- ND_PRINT((ndo, "\t "));
+ if (j == '\n') /* lets rework the version string to
+ get a nice indentation */
+ ND_PRINT((ndo, "\n\t "));
+ else
+ fn_print_char(ndo, j);
}
break;
case 0x06: /* Platform */