X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3d932490b826facb568937a1290910a1265267f5..fb8b947488c7f22b518de1df1a91e663dc7ab33c:/print-telnet.c diff --git a/print-telnet.c b/print-telnet.c index 35998fcf..4911e5ca 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -50,8 +50,8 @@ #endif #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.20 2002-08-01 08:53:32 risso Exp $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.24 2003-12-29 11:05:10 hannes Exp $"; #endif #include @@ -109,7 +109,8 @@ numstr(int x) static int telnet_parse(const u_char *sp, u_int length, int print) { - int i, c, x; + int i, x; + u_int c; const u_char *osp, *p; #define FETCH(c, sp, length) \ do { \ @@ -155,7 +156,7 @@ telnet_parse(const u_char *sp, u_int length, int print) break; /* IAC SB .... IAC SE */ p = sp; - while (length > p + 1 - sp) { + while (length > (u_int)(p + 1 - sp)) { if (p[0] == IAC && p[1] == SE) break; p++; @@ -243,7 +244,7 @@ telnet_print(const u_char *sp, u_int length) if (Xflag && 2 < vflag) { if (first) printf("\nTelnet:"); - hex_print_with_offset(sp, l, sp - osp); + hex_print_with_offset("\n", sp, l, sp - osp); if (l > 8) printf("\n\t\t\t\t"); else