summaryrefslogtreecommitdiff
path: root/util-print.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-10 16:22:37 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-05 14:59:21 +0200
commit929e4be621ebdcede37865a5767a175f083f9138 (patch)
treebf6ecbc038696e66176b2d50e04e015767f23b3d /util-print.c
parent54b5db3dde658894be730b15480f9b6e27b717a0 (diff)
downloadtcpdump-test-rc.tar.gz
Remove many (761) redundant ND_TCHECK_n() callstest-rc
ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }. They are redundant because they are followed by a GET_.*_n(e) call, same n, same e, which do the bounds check. Remove unused 'trunc' labels and most associated codes. Update the outputs of some tests accordingly.
Diffstat (limited to 'util-print.c')
-rw-r--r--util-print.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/util-print.c b/util-print.c
index cf45b386..e22e535e 100644
--- a/util-print.c
+++ b/util-print.c
@@ -778,7 +778,6 @@ print_txt_line(netdissect_options *ndo, const char *prefix,
startidx = idx;
while (idx < len) {
- ND_TCHECK_1(pptr + idx);
c = GET_U_1(pptr + idx);
if (c == '\n') {
/*
@@ -795,7 +794,6 @@ print_txt_line(netdissect_options *ndo, const char *prefix,
/* not in this packet */
return (0);
}
- ND_TCHECK_1(pptr + idx + 1);
if (GET_U_1(pptr + idx + 1) == '\n') {
/*
* CR-LF; end of line.
@@ -828,7 +826,6 @@ print_txt_line(netdissect_options *ndo, const char *prefix,
* All printable ASCII, but no line ending after that point
* in the buffer; treat this as if it were truncated.
*/
-trunc:
linelen = idx - startidx;
ND_PRINT("%s%.*s", prefix, (int)linelen, pptr + startidx);
nd_print_trunc(ndo);