Trick View: Can't set variables with -- units #301

Test before trying to convert NULL char * to string.
This commit is contained in:
Alex Lin 2016-09-06 13:53:37 -05:00
parent b32015a1ad
commit c4a32600cc

View File

@ -525,8 +525,11 @@ int var_set_base( const char * var , T value , const char * units ) {
V_DATA v_data ; V_DATA v_data ;
v_tree.v_data = &v_data ; v_tree.v_data = &v_data ;
var_set_value( v_data , value) ; var_set_value( v_data , value) ;
//ref->units = (char *)units ; if ( units != NULL ) {
ref->units = (char *)(map_trick_units_to_udunits(units).c_str()) ; ref->units = (char *)(map_trick_units_to_udunits(units).c_str()) ;
} else {
ref->units = (char *)units ;
}
ref_assignment(ref , &v_tree) ; ref_assignment(ref , &v_tree) ;
free(ref) ; free(ref) ;
} else { } else {