*** /vol/src//gated/dist/3.5/src/aspath.c	Mon Apr 10 13:09:22 1995
--- aspath.c	Tue Apr 11 12:50:12 1995
***************
*** 1638,1644 ****
  		pp = PATH_PTR(asp);
  		lastsegtype = PA_PATH_NOTSETORSEQ;
  
! 		while (nseg > 0) {
  		    segtype = (u_short)(*bp++);
  		    seglen = (u_short)(*bp++);
  
--- 1638,1644 ----
  		pp = PATH_PTR(asp);
  		lastsegtype = PA_PATH_NOTSETORSEQ;
  
! 		while (nas > 0) {
  		    segtype = (u_short)(*bp++);
  		    seglen = (u_short)(*bp++);
  
***************
*** 1648,1653 ****
--- 1648,1654 ----
  		    if (seglen == 0) {
  			continue;
  		    }
+ 		    nas -= seglen;
  
  		    /*
  		     * If the segment is a sequence, make a new segment
***************
*** 1665,1671 ****
  			    segp[-1] += (u_short)seglen;
  			} else {
  			    *segp++ = (u_short)seglen;
- 			    nseg--;
  			    lastsegtype = PA_PATH_SEQ;
  			}
  			while (seglen-- > 0) {
--- 1666,1671 ----
***************
*** 1681,1687 ****
  			 * AS path is a load of shit).  Rethink later.
  			 */
  			*segp++ = ((u_short)seglen) | PATH_AS_SET;
- 			nseg--;
  			lastsegtype = PA_PATH_SET;
  			segstart = pp;
  			oldas = (-1);
--- 1681,1686 ----

