diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-13 08:58:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-13 08:58:17 +0000 |
commit | 9985115b8baf5bb77f376647f505a7892ba61028 (patch) | |
tree | f490426cc9cf304561779db94f5dbc3eef6c5395 | |
parent | ead1cadaf3100560e373cc7395d09744d3288ef4 (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
-rw-r--r-- | packet-atalk.c | 4 | ||||
-rw-r--r-- | packet-ftp.c | 4 | ||||
-rw-r--r-- | packet-http.c | 4 | ||||
-rw-r--r-- | packet-nbipx.c | 6 | ||||
-rw-r--r-- | packet-nntp.c | 4 | ||||
-rw-r--r-- | packet-pop.c | 4 | ||||
-rw-r--r-- | packet-rsh.c | 4 | ||||
-rw-r--r-- | packet-rtsp.c | 4 | ||||
-rw-r--r-- | packet-sdp.c | 4 | ||||
-rw-r--r-- | packet-smtp.c | 6 | ||||
-rw-r--r-- | packet-telnet.c | 8 | ||||
-rw-r--r-- | packet-tftp.c | 4 |
12 files changed, 28 insertions, 28 deletions
diff --git a/packet-atalk.c b/packet-atalk.c index 37daca638f..6eb0587fc6 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,7 +1,7 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.42 2000/11/13 04:26:14 guy Exp $ + * $Id: packet-atalk.c,v 1.43 2000/11/13 08:57:57 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -262,7 +262,7 @@ dissect_rtmp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { offset += 3 + nodelen; i = 1; - while (tvb_length_remaining(tvb, offset) != 0) { + while (tvb_offset_exists(tvb, offset)) { proto_tree *tuple_item, *tuple_tree; guint16 tuple_net; guint8 tuple_dist; diff --git a/packet-ftp.c b/packet-ftp.c index 461c107886..6ca8fd315d 100644 --- a/packet-ftp.c +++ b/packet-ftp.c @@ -2,7 +2,7 @@ * Routines for ftp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-ftp.c,v 1.21 2000/11/10 08:02:34 guy Exp $ + * $Id: packet-ftp.c,v 1.22 2000/11/13 08:57:59 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -163,7 +163,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Show the rest of the request or response as text, * a line at a time. */ - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-http.c b/packet-http.c index 85aa18bb10..82444557e5 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-http.c,v 1.25 2000/11/09 10:56:31 guy Exp $ + * $Id: packet-http.c,v 1.26 2000/11/13 08:58:01 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -107,7 +107,7 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Process the packet data, a line at a time. */ - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-nbipx.c b/packet-nbipx.c index 30e0a97d40..420bf4a637 100644 --- a/packet-nbipx.c +++ b/packet-nbipx.c @@ -2,7 +2,7 @@ * Routines for NetBIOS over IPX packet disassembly * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-nbipx.c,v 1.25 2000/11/10 21:29:27 gram Exp $ + * $Id: packet-nbipx.c,v 1.26 2000/11/13 08:58:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -269,7 +269,7 @@ dissect_nbipx_dg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; offset += NETBIOS_NAME_LEN; - if (tvb_length_remaining(tvb, offset) != 0) { + if (tvb_offset_exists(tvb, offset)) { next_tvb = tvb_new_subset(tvb, offset, -1, -1); tvb_compat(next_tvb, &next_pd, &next_offset); dissect_smb(next_pd, next_offset, pinfo->fd, tree, @@ -417,7 +417,7 @@ dissect_nwlink_dg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 68; - if (tvb_length_remaining(tvb, offset) != 0) { + if (tvb_offset_exists(tvb, offset)) { next_tvb = tvb_new_subset(tvb, offset, -1, -1); switch (packet_type) { diff --git a/packet-nntp.c b/packet-nntp.c index 5d2580965d..4ca64f616a 100644 --- a/packet-nntp.c +++ b/packet-nntp.c @@ -2,7 +2,7 @@ * Routines for nntp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-nntp.c,v 1.14 2000/11/09 10:56:32 guy Exp $ + * $Id: packet-nntp.c,v 1.15 2000/11/13 08:58:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -105,7 +105,7 @@ dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * matching request was, although the latter requires us to * know what the matching request was.... */ - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-pop.c b/packet-pop.c index 74bcc1e5ce..c41ccfcd1a 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,7 +2,7 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-pop.c,v 1.18 2000/11/10 08:02:34 guy Exp $ + * $Id: packet-pop.c,v 1.19 2000/11/13 08:58:07 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -166,7 +166,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Show the rest of the request or response as text, * a line at a time. */ - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-rsh.c b/packet-rsh.c index 5d558fde03..06536f61fd 100644 --- a/packet-rsh.c +++ b/packet-rsh.c @@ -4,7 +4,7 @@ * Robert Tsai <rtsai@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu> * - * $Id: packet-rsh.c,v 1.5 2000/11/09 10:56:32 guy Exp $ + * $Id: packet-rsh.c,v 1.6 2000/11/13 08:58:08 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -78,7 +78,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Process the packet data, a line at a time. */ - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-rtsp.c b/packet-rtsp.c index b2d6de0266..d0699262c9 100644 --- a/packet-rtsp.c +++ b/packet-rtsp.c @@ -4,7 +4,7 @@ * Jason Lango <jal@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu> * - * $Id: packet-rtsp.c,v 1.24 2000/11/12 21:23:53 guy Exp $ + * $Id: packet-rtsp.c,v 1.25 2000/11/13 08:58:10 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -233,7 +233,7 @@ dissect_rtsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Process the packet data, a line at a time. */ - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-sdp.c b/packet-sdp.c index 53c7048f21..0dfc80b311 100644 --- a/packet-sdp.c +++ b/packet-sdp.c @@ -4,7 +4,7 @@ * Jason Lango <jal@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu> * - * $Id: packet-sdp.c,v 1.14 2000/11/13 01:43:02 guy Exp $ + * $Id: packet-sdp.c,v 1.15 2000/11/13 08:58:12 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -98,7 +98,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Show the SDP message a line at a time. */ section = 0; - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ diff --git a/packet-smtp.c b/packet-smtp.c index 85ace8b9b5..45a5f6d87a 100644 --- a/packet-smtp.c +++ b/packet-smtp.c @@ -1,7 +1,7 @@ /* packet-smtp.c * Routines for SMTP packet disassembly * - * $Id: packet-smtp.c,v 1.10 2000/11/12 03:13:44 guy Exp $ + * $Id: packet-smtp.c,v 1.11 2000/11/13 08:58:13 guy Exp $ * * Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -435,7 +435,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Message body. * Put its lines into the protocol tree, a line at a time. */ - while (tvb_length_remaining(tvb, offset) != 0) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. @@ -504,7 +504,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * that doesn't have a continuation indication on it. */ - while (tvb_length_remaining(tvb, offset) != 0) { + while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. 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) { /* diff --git a/packet-tftp.c b/packet-tftp.c index fff4597916..bc9e11b09a 100644 --- a/packet-tftp.c +++ b/packet-tftp.c @@ -5,7 +5,7 @@ * Craig Newell <CraigN@cheque.uq.edu.au> * RFC2347 TFTP Option Extension * - * $Id: packet-tftp.c,v 1.16 2000/11/10 09:22:46 guy Exp $ + * $Id: packet-tftp.c,v 1.17 2000/11/13 08:58:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -212,7 +212,7 @@ tftp_dissect_options(tvbuff_t *tvb, int offset, proto_tree *tree) { int i1, i2; - while (tvb_length_remaining(tvb, offset)) { + while (tvb_offset_exists(tvb, offset)) { i1 = tvb_strnlen(tvb, offset, -1); /* length of option */ i2 = tvb_strnlen(tvb, offset+i1+1, -1); /* length of value */ proto_tree_add_text(tree, tvb, offset, i1+i2+2, |