Skip to content
Snippets Groups Projects
Commit e1282d0f authored by Aleksandr Lysikov's avatar Aleksandr Lysikov
Browse files

fixed some bugs

parent 722d71e3
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ char * extract_group_prefix (const char * a_group) ...@@ -51,7 +51,7 @@ char * extract_group_prefix (const char * a_group)
} else { } else {
l_group_prefix_size = (size_t)l_delimeter- (size_t) a_group; l_group_prefix_size = (size_t)l_delimeter- (size_t) a_group;
if ( l_group_prefix_size > 1 ) if ( l_group_prefix_size > 1 )
l_group_prefix = strndup(a_group, l_group_prefix_size-1); l_group_prefix = strndup(a_group, l_group_prefix_size);
} }
return l_group_prefix; return l_group_prefix;
} }
...@@ -229,7 +229,7 @@ bool dap_chain_global_db_gr_set(const char *a_key, const void *a_value, size_t a ...@@ -229,7 +229,7 @@ bool dap_chain_global_db_gr_set(const char *a_key, const void *a_value, size_t a
int l_res = dap_db_add(store_data, 1); int l_res = dap_db_add(store_data, 1);
// Extract prefix if added successfuly, add history log and call notify callback if present // Extract prefix if added successfuly, add history log and call notify callback if present
if (l_res>0 ){ if (!l_res ){
char * l_group_prefix = extract_group_prefix (a_group); char * l_group_prefix = extract_group_prefix (a_group);
history_group_item_t * l_history_group_item = NULL; history_group_item_t * l_history_group_item = NULL;
if ( l_group_prefix ) if ( l_group_prefix )
...@@ -249,7 +249,7 @@ bool dap_chain_global_db_gr_set(const char *a_key, const void *a_value, size_t a ...@@ -249,7 +249,7 @@ bool dap_chain_global_db_gr_set(const char *a_key, const void *a_value, size_t a
pthread_mutex_unlock(&ldb_mutex); pthread_mutex_unlock(&ldb_mutex);
DAP_DELETE(store_data); DAP_DELETE(store_data);
return l_res> 0; return !l_res;
} }
bool dap_chain_global_db_set(const char *a_key, const void *a_value, size_t a_value_len) bool dap_chain_global_db_set(const char *a_key, const void *a_value, size_t a_value_len)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment