File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -3093,7 +3093,7 @@ static uint8_t *save_conf(const Group_c *g, uint8_t *data)
3093
3093
host_to_lendian_bytes16 (data , g -> peer_number );
3094
3094
data += sizeof (uint16_t );
3095
3095
3096
- host_to_lendian_bytes32 ( data , g -> numpeers - 1 + g -> numfrozen ) ;
3096
+ uint8_t * numsaved_location = data ;
3097
3097
data += sizeof (uint32_t );
3098
3098
3099
3099
* data = g -> title_len ;
@@ -3102,24 +3102,20 @@ static uint8_t *save_conf(const Group_c *g, uint8_t *data)
3102
3102
memcpy (data , g -> title , g -> title_len );
3103
3103
data += g -> title_len ;
3104
3104
3105
- #ifndef NDEBUG
3106
- bool found_self = false;
3107
- #endif
3105
+ uint32_t numsaved = 0 ;
3108
3106
3109
3107
for (uint32_t j = 0 ; j < g -> numpeers + g -> numfrozen ; ++ j ) {
3110
3108
const Group_Peer * peer = (j < g -> numpeers ) ? & g -> group [j ] : & g -> frozen [j - g -> numpeers ];
3111
3109
3112
3110
if (id_equal (peer -> real_pk , g -> real_pk )) {
3113
- #ifndef NDEBUG
3114
- found_self = true;
3115
- #endif
3116
3111
continue ;
3117
3112
}
3118
3113
3119
3114
data = save_peer (peer , data );
3115
+ ++ numsaved ;
3120
3116
}
3121
3117
3122
- assert ( found_self );
3118
+ host_to_lendian_bytes32 ( numsaved_location , numsaved );
3123
3119
3124
3120
return data ;
3125
3121
}
You can’t perform that action at this time.
0 commit comments