aboutsummaryrefslogtreecommitdiffstats
path: root/packet-telnet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-13 08:58:17 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-13 08:58:17 +0000
commit9985115b8baf5bb77f376647f505a7892ba61028 (patch)
treef490426cc9cf304561779db94f5dbc3eef6c5395 /packet-telnet.c
parentead1cadaf3100560e373cc7395d09744d3288ef4 (diff)
Use "tvb_offset_exists()" rather than "tvb_length_remaining()" to check
whether there's any data left in the tvbuff starting at a specified offset. svn path=/trunk/; revision=2636
Diffstat (limited to 'packet-telnet.c')
-rw-r--r--packet-telnet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-telnet.c b/packet-telnet.c
index 28696277e6..52869eabd4 100644
--- a/packet-telnet.c
+++ b/packet-telnet.c
@@ -2,7 +2,7 @@
* Routines for telnet packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-telnet.c,v 1.19 2000/11/12 00:59:07 guy Exp $
+ * $Id: packet-telnet.c,v 1.20 2000/11/13 08:58:15 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -305,7 +305,7 @@ telnet_add_text(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
guint8 c;
gboolean last_char_was_cr;
- while (len != 0 && tvb_length_remaining(tvb, offset) != 0) {
+ while (len != 0 && tvb_offset_exists(tvb, offset)) {
/*
* Find the end of the line.
*/
@@ -329,7 +329,7 @@ telnet_add_text(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
*/
if (tvb_get_guint8(tvb, offset + linelen) == '\r') {
last_char_was_cr = TRUE;
- while (len != 0 && tvb_length_remaining(tvb, next_offset) != 0) {
+ while (len != 0 && tvb_offset_exists(tvb, next_offset)) {
c = tvb_get_guint8(tvb, next_offset);
next_offset++; /* skip over that character */
len--;
@@ -386,7 +386,7 @@ dissect_telnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Scan through the buffer looking for an IAC byte.
*/
- while ((len = tvb_length_remaining(tvb, offset)) != 0) {
+ while ((len = tvb_length_remaining(tvb, offset)) > 0) {
iac_offset = tvb_find_guint8(tvb, offset, len, TN_IAC);
if (iac_offset != -1) {
/*