Ethereal-users: Re: [ethereal-users] One strange thing about the MS Netmon 2.x capture file

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Thu, 23 Mar 2000 02:50:08 -0800
> I have a patch to do so; I also got rid of some unnecessary temporary
> string buffers, and cleaned it up some (in part so that I could figure
> out what the temporary string buffers were doing, and to replace
> references to them to references to the packet data itself).

And here's a patch atop my previous one, to get rid of some unnecessary
variables/arguments.
Index: packet-telnet.c
===================================================================
RCS file: /usr/local/cvsroot/ethereal/packet-telnet.c,v
retrieving revision 1.9
diff -c -r1.9 packet-telnet.c
*** packet-telnet.c	2000/03/23 10:25:38	1.9
--- packet-telnet.c	2000/03/23 10:48:17
***************
*** 182,189 ****
  }
  
  static int
! telnet_command(proto_tree *telnet_tree, const u_char *pd,
! 		int start_offset, int max_data) 
  {
    int offset = start_offset;
    u_char optcode;
--- 182,188 ----
  }
  
  static int
! telnet_command(proto_tree *telnet_tree, const u_char *pd, int start_offset)
  {
    int offset = start_offset;
    u_char optcode;
***************
*** 295,311 ****
  dissect_telnet(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
  {
          proto_tree      *telnet_tree, *ti;
- 	int max_data = pi.captured_len - offset;
  
  	if (check_col(fd, COL_PROTOCOL))
  		col_add_str(fd, COL_PROTOCOL, "TELNET");
  
! 	if (check_col(fd, COL_INFO)) {
! 
  	  col_add_fstr(fd, COL_INFO, "Telnet Data ...");
  
- 	}
- 
  	if (tree) {
  	  int data_offset;
  	  int data_len;
--- 294,306 ----
  dissect_telnet(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
  {
          proto_tree      *telnet_tree, *ti;
  
  	if (check_col(fd, COL_PROTOCOL))
  		col_add_str(fd, COL_PROTOCOL, "TELNET");
  
! 	if (check_col(fd, COL_INFO))
  	  col_add_fstr(fd, COL_INFO, "Telnet Data ...");
  
  	if (tree) {
  	  int data_offset;
  	  int data_len;
***************
*** 336,342 ****
  	      /*
  	       * Now interpret the command.
  	       */
! 	      offset = telnet_command(telnet_tree, pd, offset, max_data);
  	      data_offset = offset;
  	    }
  	    else {
--- 331,337 ----
  	      /*
  	       * Now interpret the command.
  	       */
! 	      offset = telnet_command(telnet_tree, pd, offset);
  	      data_offset = offset;
  	    }
  	    else {