@@ -642,7 +642,7 @@ bid_t comp_var_getID(const char *var_name) {
642642 comp_prepare_name (tmp , baseof (var_name , '/' ), SB_KEYWORD_SIZE );
643643
644644 char * dot = strchr (tmp , '.' );
645- if (dot != 0 && * (dot + 1 ) == 0 ) {
645+ if (dot != NULL && * (dot + 1 ) == 0 ) {
646646 // name ends with dot
647647 sc_raise (MSG_MEMBER_DOES_NOT_EXISTS , tmp );
648648 return 0 ;
@@ -654,7 +654,7 @@ bid_t comp_var_getID(const char *var_name) {
654654 //
655655 // If the name is not found in comp_libtable then it
656656 // is treated as a structure reference
657- if (dot != 0 && comp_check_lib (tmp )) {
657+ if (dot != NULL && comp_check_lib (tmp )) {
658658 for (i = 0 ; i < comp_varcount ; i ++ ) {
659659 if (strcmp (comp_vartable [i ].name , tmp ) == 0 ) {
660660 return i ;
@@ -709,7 +709,7 @@ bid_t comp_var_getID(const char *var_name) {
709709void comp_add_variable (bc_t * bc , const char * var_name ) {
710710 char * dot = strchr (var_name , '.' );
711711
712- if (dot != 0 && !comp_check_lib (var_name )) {
712+ if (dot != NULL && !comp_check_lib (var_name )) {
713713 // uds-element (or sub-element eg foo.x.y.z)
714714 // record the uds-parent
715715
@@ -4038,7 +4038,13 @@ int comp_pass1(const char *section, const char *text) {
40384038 for (i = 0 ; i < comp_udpcount ; i ++ ) {
40394039 if (comp_udptable [i ].ip == INVALID_ADDR ) {
40404040 comp_line = comp_udptable [i ].pline ;
4041- sc_raise (MSG_UNDEFINED_UDP , comp_udptable [i ].name );
4041+ char * dot = strchr (comp_udptable [i ].name , '.' );
4042+ if (dot ) {
4043+ sc_raise (MSG_UNDEFINED_HASH , comp_udptable [i ].name );
4044+ } else {
4045+ sc_raise (MSG_UNDEFINED_UDP , comp_udptable [i ].name );
4046+ }
4047+ break ;
40424048 }
40434049 }
40444050 }
0 commit comments