X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/fcc82f451d3e51fdf636abbf927edb287bada0e0..859d3eb8b99b36161e553d515d63de6b50c952f9:/print-tftp.c diff --git a/print-tftp.c b/print-tftp.c index d09a5ba6..9d1c064e 100644 --- a/print-tftp.c +++ b/print-tftp.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-tftp.c,v 1.33 2002-12-11 07:14:09 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-tftp.c,v 1.35 2003-05-02 08:45:21 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -109,6 +109,18 @@ tftp_print(register const u_char *bp, u_int length) fputs(" \"", stdout); i = fn_print(p, snapend); putchar('"'); + + /* Print the mode and any options */ + while ((p = (const u_char *)strchr((const char *)p, '\0')) != NULL) { + if (length <= (u_int)(p - (const u_char *)&tp->th_block)) + break; + p++; + if (*p != '\0') { + putchar(' '); + fn_print(p, snapend); + } + } + if (i) goto trunc; break;