summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/tcpdump.c
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2012-07-11 10:37:38 +0000
committersthen <sthen@openbsd.org>2012-07-11 10:37:38 +0000
commita0183b03da205110e8fa6758b5576e4f8d20ff61 (patch)
treebb5e8ae4d0f4adfe6456f33947f9e4bde80cd9b7 /usr.sbin/tcpdump/tcpdump.c
parentSimplify guts and calling of getuint(). Eliminate a useless 'help' (diff)
downloadwireguard-openbsd-a0183b03da205110e8fa6758b5576e4f8d20ff61.tar.xz
wireguard-openbsd-a0183b03da205110e8fa6758b5576e4f8d20ff61.zip
cleanup offset argument in default_print_* functions, pointed out by Mike Small
ok theo
Diffstat (limited to 'usr.sbin/tcpdump/tcpdump.c')
-rw-r--r--usr.sbin/tcpdump/tcpdump.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index ecd42fd1dfa..509661b26a5 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdump.c,v 1.64 2012/07/10 18:07:37 sthen Exp $ */
+/* $OpenBSD: tcpdump.c,v 1.65 2012/07/11 10:37:38 sthen Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -561,7 +561,7 @@ gotchld(int signo)
/* dump the buffer in `emacs-hexl' style */
void
-default_print_hexl(const u_char *cp, unsigned int length, unsigned int offset)
+default_print_hexl(const u_char *cp, unsigned int length)
{
unsigned int i, j, jm;
int c;
@@ -569,8 +569,7 @@ default_print_hexl(const u_char *cp, unsigned int length, unsigned int offset)
printf("\n");
for (i = 0; i < length; i += 0x10) {
- snprintf(ln, sizeof(ln), " %04x: ",
- (unsigned int)(i + offset));
+ snprintf(ln, sizeof(ln), " %04x: ", (unsigned int)i);
jm = length - i;
jm = jm > 16 ? 16 : jm;
@@ -605,7 +604,7 @@ default_print_hexl(const u_char *cp, unsigned int length, unsigned int offset)
/* dump the text from the buffer */
void
-default_print_ascii(const u_char *cp, unsigned int length, unsigned int offset)
+default_print_ascii(const u_char *cp, unsigned int length)
{
int c, i;
@@ -626,10 +625,10 @@ default_print_unaligned(register const u_char *cp, register u_int length)
if (Xflag) {
/* dump the buffer in `emacs-hexl' style */
- default_print_hexl(cp, length, 0);
+ default_print_hexl(cp, length);
} else if (Aflag) {
/* dump the text in the buffer */
- default_print_ascii(cp, length, 0);
+ default_print_ascii(cp, length);
} else {
/* dump the buffer in old tcpdump style */
nshorts = (u_int) length / sizeof(u_short);
@@ -657,10 +656,10 @@ default_print(register const u_char *bp, register u_int length)
if (Xflag) {
/* dump the buffer in `emacs-hexl' style */
- default_print_hexl(bp, length, 0);
+ default_print_hexl(bp, length);
} else if (Aflag) {
/* dump the text in the buffer */
- default_print_ascii(bp, length, 0);
+ default_print_ascii(bp, length);
} else {
/* dump the buffer in old tcpdump style */
if ((long)bp & 1) {