@@ -871,19 +871,13 @@ handle_chap(netdissect_options *ndo,
871
871
}
872
872
name_size = len - (u_int )(p - p0 );
873
873
ND_PRINT (", Name " );
874
- for (i = 0 ; i < name_size ; i ++ ) {
875
- fn_print_char (ndo , GET_U_1 (p ));
876
- p ++ ;
877
- }
874
+ nd_printjn (ndo , p , name_size );
878
875
break ;
879
876
case CHAP_SUCC :
880
877
case CHAP_FAIL :
881
878
msg_size = len - (u_int )(p - p0 );
882
879
ND_PRINT (", Msg " );
883
- for (i = 0 ; i < msg_size ; i ++ ) {
884
- fn_print_char (ndo , GET_U_1 (p ));
885
- p ++ ;
886
- }
880
+ nd_printjn (ndo , p , msg_size );
887
881
break ;
888
882
}
889
883
}
@@ -896,7 +890,6 @@ handle_pap(netdissect_options *ndo,
896
890
u_int code , len ;
897
891
u_int peerid_len , passwd_len , msg_len ;
898
892
const u_char * p0 ;
899
- u_int i ;
900
893
901
894
p0 = p ;
902
895
if (length < 1 ) {
@@ -941,10 +934,8 @@ handle_pap(netdissect_options *ndo,
941
934
if (length - (p - p0 ) < peerid_len )
942
935
return ;
943
936
ND_PRINT (", Peer " );
944
- for (i = 0 ; i < peerid_len ; i ++ ) {
945
- fn_print_char (ndo , GET_U_1 (p ));
946
- p ++ ;
947
- }
937
+ nd_printjn (ndo , p , peerid_len );
938
+ p += peerid_len ;
948
939
949
940
if (length - (p - p0 ) < 1 )
950
941
return ;
@@ -953,10 +944,7 @@ handle_pap(netdissect_options *ndo,
953
944
if (length - (p - p0 ) < passwd_len )
954
945
return ;
955
946
ND_PRINT (", Name " );
956
- for (i = 0 ; i < passwd_len ; i ++ ) {
957
- fn_print_char (ndo , GET_U_1 (p ));
958
- p ++ ;
959
- }
947
+ nd_printjn (ndo , p , passwd_len );
960
948
break ;
961
949
case PAP_AACK :
962
950
case PAP_ANAK :
@@ -974,10 +962,7 @@ handle_pap(netdissect_options *ndo,
974
962
if (length - (p - p0 ) < msg_len )
975
963
return ;
976
964
ND_PRINT (", Msg " );
977
- for (i = 0 ; i < msg_len ; i ++ ) {
978
- fn_print_char (ndo , GET_U_1 (p ));
979
- p ++ ;
980
- }
965
+ nd_printjn (ndo , p , msg_len );
981
966
break ;
982
967
}
983
968
return ;
0 commit comments