diff --git a/env.c b/env.c index fec6dfc35..276de50ec 100644 --- a/env.c +++ b/env.c @@ -820,14 +820,19 @@ void env_set( const wchar_t *key, static int try_remove( env_node_t *n, const wchar_t *key ) { + const void *old_key_void, *old_val_void; wchar_t *old_key, *old_val; if( n == 0 ) return 0; hash_remove( &n->env, key, - (const void **)&old_key, - (const void **)&old_val ); + &old_key_void, + &old_val_void ); + + old_key = (wchar_t *)old_key_void; + old_val = (wchar_t *)old_val_void; + if( old_key != 0 ) { var_entry_t * v = (var_entry_t *)old_val; diff --git a/function.c b/function.c index e0e995cdd..45e24c66d 100644 --- a/function.c +++ b/function.c @@ -195,14 +195,17 @@ int function_exists( const wchar_t *cmd ) void function_remove( const wchar_t *name ) { void *key; + const void *dv; function_data_t *d; event_t ev; hash_remove( &function, name, (const void **) &key, - (const void **)&d ); + &dv ); + d=(function_data_t *)dv; + if( !key ) return;