Browse code

Merge 61b355399ad50a9047951f22fe1c9839e421b2c5 into 1f1297b407be0525e314b9d734d39a1a20ed886d

russagit authored on 08/08/2022 14:51:03 • GitHub committed on 08/08/2022 14:51:03
Showing 1 changed files
... ...
@@ -570,7 +570,7 @@ int isup_get_generic_number_nai(unsigned char *buf, int len)
570 570
 
571 571
 	if(offset != -1 && len-offset-2 > 1)
572 572
 	{
573
-		 return buf[offset+2] & 0x7F;
573
+		 return buf[offset+3] & 0x7F;
574 574
 	}
575 575
 	return -1;
576 576
 }
... ...
@@ -586,13 +586,13 @@ int isup_get_generic_number(unsigned char *buf, int len, char* sb_buf)
586 586
 	if(offset != -1 && len-offset-2 > 1)
587 587
 	{
588 588
 		sbparamlen = (buf[offset+1] & 0xFF) - 2;
589
-		oddeven = (buf[offset+2] >> 7) & 0x1;
589
+		oddeven = (buf[offset+3] >> 7) & 0x1;
590 590
 
591 591
 		while ((sbparamlen > 0) && (buf[offset] != 0)) {
592
-			sb_buf[sb_i]="0123456789ABCDEF"[(buf[offset+4+sb_j] & 0x0F)];
592
+			sb_buf[sb_i]="0123456789ABCDEF"[(buf[offset+5+sb_j] & 0x0F)];
593 593
 			if(sbparamlen > 1 || oddeven == 0) 
594 594
 			{
595
-				sb_buf[sb_i+1]="0123456789ABCDEF"[(buf[offset+4+sb_j] >>4 & 0x0F)];
595
+				sb_buf[sb_i+1]="0123456789ABCDEF"[(buf[offset+5+sb_j] >>4 & 0x0F)];
596 596
 			}
597 597
 			sb_i=sb_i+2;
598 598
 			sbparamlen--;