@@ -123,7 +123,7 @@ nc_server_config_ssh_opts_free(struct nc_server_ssh_opts *opts)
123123 struct nc_hostkey * hostkey ;
124124 struct nc_auth_client * auth_client ;
125125 struct nc_public_key * pubkey ;
126- LY_ARRAY_COUNT_TYPE i , j ;
126+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
127127
128128 if (!opts ) {
129129 return ;
@@ -179,7 +179,7 @@ static void
179179nc_server_config_tls_opts_free (struct nc_server_tls_opts * opts )
180180{
181181 struct nc_ctn * ctn , * next ;
182- LY_ARRAY_COUNT_TYPE i ;
182+ LY_ARRAY_COUNT_TYPE i = 0 ;
183183
184184 if (!opts ) {
185185 return ;
@@ -243,7 +243,7 @@ static void
243243nc_server_config_unix_opts_free (struct nc_server_unix_opts * opts )
244244{
245245 struct nc_server_unix_user_mapping * mapping ;
246- LY_ARRAY_COUNT_TYPE i , j ;
246+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
247247
248248 if (!opts ) {
249249 return ;
@@ -275,7 +275,7 @@ static void
275275nc_server_config_keystore_free (struct nc_keystore * ks )
276276{
277277 struct nc_keystore_entry * entry ;
278- LY_ARRAY_COUNT_TYPE i , j ;
278+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
279279
280280 if (!ks ) {
281281 return ;
@@ -309,7 +309,7 @@ nc_server_config_truststore_free(struct nc_truststore *ts)
309309{
310310 struct nc_certificate_bag * cbag ;
311311 struct nc_public_key_bag * pkbag ;
312- LY_ARRAY_COUNT_TYPE i , j ;
312+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
313313
314314 if (!ts ) {
315315 return ;
@@ -359,7 +359,7 @@ nc_server_config_free(struct nc_server_config *config)
359359 struct nc_endpt * endpt ;
360360 struct nc_ch_client * ch_client ;
361361 struct nc_ch_endpt * ch_endpt ;
362- LY_ARRAY_COUNT_TYPE i , j ;
362+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
363363 char * socket_path = NULL ;
364364
365365 if (!config ) {
@@ -599,7 +599,7 @@ config_local_bind(const struct lyd_node *node, enum nc_operation parent_op, stru
599599 enum nc_operation op ;
600600 struct nc_bind * bind = NULL ;
601601 const char * local_addr ;
602- LY_ARRAY_COUNT_TYPE i ;
602+ LY_ARRAY_COUNT_TYPE i = 0 ;
603603
604604 NC_NODE_GET_OP (node , parent_op , & op );
605605
@@ -963,7 +963,7 @@ config_ssh_hostkey(const struct lyd_node *node, enum nc_operation parent_op, str
963963 enum nc_operation op ;
964964 struct nc_hostkey * hostkey = NULL ;
965965 const char * name ;
966- LY_ARRAY_COUNT_TYPE i ;
966+ LY_ARRAY_COUNT_TYPE i = 0 ;
967967
968968 NC_NODE_GET_OP (node , parent_op , & op );
969969
@@ -1104,7 +1104,7 @@ config_ssh_user_public_key(const struct lyd_node *node, enum nc_operation parent
11041104 enum nc_operation op ;
11051105 struct lyd_node * n ;
11061106 struct nc_public_key * key = NULL ;
1107- LY_ARRAY_COUNT_TYPE i ;
1107+ LY_ARRAY_COUNT_TYPE i = 0 ;
11081108 const char * name ;
11091109
11101110 NC_NODE_GET_OP (node , parent_op , & op );
@@ -2151,7 +2151,7 @@ config_tls_client_auth_ca_cert(const struct lyd_node *node,
21512151 enum nc_operation op ;
21522152 struct lyd_node * n ;
21532153 const char * name ;
2154- LY_ARRAY_COUNT_TYPE i ;
2154+ LY_ARRAY_COUNT_TYPE i = 0 ;
21552155 struct nc_certificate * cert = NULL ;
21562156
21572157 NC_NODE_GET_OP (node , parent_op , & op );
@@ -2274,7 +2274,7 @@ config_tls_client_auth_ee_cert(const struct lyd_node *node,
22742274 enum nc_operation op ;
22752275 struct lyd_node * n ;
22762276 const char * name ;
2277- LY_ARRAY_COUNT_TYPE i ;
2277+ LY_ARRAY_COUNT_TYPE i = 0 ;
22782278 struct nc_certificate * cert = NULL ;
22792279
22802280 NC_NODE_GET_OP (node , parent_op , & op );
@@ -3068,7 +3068,7 @@ static int
30683068config_unix_user_mapping_netconf_user (const struct lyd_node * node , enum nc_operation parent_op , struct nc_server_unix_user_mapping * mapping )
30693069{
30703070 enum nc_operation op ;
3071- LY_ARRAY_COUNT_TYPE i ;
3071+ LY_ARRAY_COUNT_TYPE i = 0 ;
30723072 const char * user ;
30733073 char * * allowed_user ;
30743074
@@ -3126,7 +3126,7 @@ config_unix_user_mapping(const struct lyd_node *node, enum nc_operation parent_o
31263126 enum nc_operation op ;
31273127 struct nc_server_unix_user_mapping * mapping = NULL ;
31283128 const char * system_user ;
3129- LY_ARRAY_COUNT_TYPE i ;
3129+ LY_ARRAY_COUNT_TYPE i = 0 ;
31303130 struct ly_set * set = NULL ;
31313131 uint32_t j ;
31323132
@@ -3262,7 +3262,7 @@ config_endpoint(const struct lyd_node *node, enum nc_operation parent_op,
32623262 enum nc_operation op ;
32633263 struct nc_endpt * endpt = NULL ;
32643264 const char * name ;
3265- LY_ARRAY_COUNT_TYPE i ;
3265+ LY_ARRAY_COUNT_TYPE i = 0 ;
32663266 int r ;
32673267
32683268 NC_NODE_GET_OP (node , parent_op , & op );
@@ -3601,7 +3601,7 @@ config_ch_client_endpoint(const struct lyd_node *node, enum nc_operation parent_
36013601 struct lyd_node * n ;
36023602 enum nc_operation op ;
36033603 const char * name ;
3604- LY_ARRAY_COUNT_TYPE i ;
3604+ LY_ARRAY_COUNT_TYPE i = 0 ;
36053605 struct nc_ch_endpt * endpt = NULL ;
36063606
36073607 NC_NODE_GET_OP (node , parent_op , & op );
@@ -3855,7 +3855,7 @@ config_netconf_client(const struct lyd_node *node, enum nc_operation parent_op,
38553855 struct lyd_node * n ;
38563856 enum nc_operation op ;
38573857 const char * name ;
3858- LY_ARRAY_COUNT_TYPE i , j ;
3858+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
38593859 struct nc_ch_client * ch_client = NULL ;
38603860
38613861 NC_NODE_GET_OP (node , parent_op , & op );
@@ -4097,7 +4097,7 @@ config_asymmetric_key_cert(const struct lyd_node *node, enum nc_operation parent
40974097 enum nc_operation op ;
40984098 struct nc_certificate * cert = NULL ;
40994099 const char * name ;
4100- LY_ARRAY_COUNT_TYPE i ;
4100+ LY_ARRAY_COUNT_TYPE i = 0 ;
41014101
41024102 NC_NODE_GET_OP (node , parent_op , & op );
41034103
@@ -4167,7 +4167,7 @@ config_asymmetric_key(const struct lyd_node *node, enum nc_operation parent_op,
41674167 enum nc_operation op ;
41684168 const char * name ;
41694169 struct nc_keystore_entry * entry = NULL ;
4170- LY_ARRAY_COUNT_TYPE i ;
4170+ LY_ARRAY_COUNT_TYPE i = 0 ;
41714171
41724172 NC_NODE_GET_OP (node , parent_op , & op );
41734173
@@ -4382,7 +4382,7 @@ config_certificate_bag_cert(const struct lyd_node *node, enum nc_operation paren
43824382 enum nc_operation op ;
43834383 struct nc_certificate * cert = NULL ;
43844384 const char * name ;
4385- LY_ARRAY_COUNT_TYPE i ;
4385+ LY_ARRAY_COUNT_TYPE i = 0 ;
43864386
43874387 NC_NODE_GET_OP (node , parent_op , & op );
43884388
@@ -4436,7 +4436,7 @@ config_certificate_bag(const struct lyd_node *node, enum nc_operation parent_op,
44364436 enum nc_operation op ;
44374437 const char * name ;
44384438 struct nc_certificate_bag * bag = NULL ;
4439- LY_ARRAY_COUNT_TYPE i ;
4439+ LY_ARRAY_COUNT_TYPE i = 0 ;
44404440 uint32_t j ;
44414441 struct ly_set * set = NULL ;
44424442
@@ -4569,7 +4569,7 @@ config_public_key_bag_pubkey(const struct lyd_node *node, enum nc_operation pare
45694569 enum nc_operation op ;
45704570 const char * name ;
45714571 struct nc_public_key * pubkey = NULL ;
4572- LY_ARRAY_COUNT_TYPE i ;
4572+ LY_ARRAY_COUNT_TYPE i = 0 ;
45734573
45744574 NC_NODE_GET_OP (node , parent_op , & op );
45754575
@@ -4621,7 +4621,7 @@ config_public_key_bag(const struct lyd_node *node, enum nc_operation parent_op,
46214621 enum nc_operation op ;
46224622 const char * name ;
46234623 struct nc_public_key_bag * bag = NULL ;
4624- LY_ARRAY_COUNT_TYPE i ;
4624+ LY_ARRAY_COUNT_TYPE i = 0 ;
46254625 struct ly_set * set = NULL ;
46264626 uint32_t j ;
46274627
@@ -4848,7 +4848,7 @@ config_cert_exp_notif_interval(const struct lyd_node *node, enum nc_operation pa
48484848 struct lyd_node * anchor_node , * period_node ;
48494849 enum nc_operation op ;
48504850 const char * anchor_str , * period_str ;
4851- uint32_t i ;
4851+ LY_ARRAY_COUNT_TYPE i = 0 ;
48524852 struct nc_cert_exp_time anchor = {0 }, period = {0 };
48534853 struct nc_cert_exp_time_interval * interval = NULL ;
48544854
@@ -5238,7 +5238,7 @@ nc_server_config_reconcile_chclients_dispatch(struct nc_server_config *old_cfg,
52385238 struct nc_ch_client * old_ch_client , * new_ch_client ;
52395239 struct nc_server_ch_thread_arg * * ch_thread_arg ;
52405240 int found ;
5241- LY_ARRAY_COUNT_TYPE i ;
5241+ LY_ARRAY_COUNT_TYPE i = 0 ;
52425242 char * * started_clients = NULL , * * client_name = NULL ;
52435243
52445244 if (!server_opts .ch_dispatch_data .acquire_ctx_cb || !server_opts .ch_dispatch_data .release_ctx_cb ||
@@ -5752,7 +5752,7 @@ static int
57525752nc_server_config_truststore_dup (const struct nc_truststore * src , struct nc_truststore * dst )
57535753{
57545754 int rc = 0 ;
5755- LY_ARRAY_COUNT_TYPE i , j ;
5755+ LY_ARRAY_COUNT_TYPE i = 0 , j = 0 ;
57565756 const struct nc_certificate_bag * src_cbag ;
57575757 struct nc_certificate_bag * dst_cbag ;
57585758 const struct nc_certificate * src_cert ;
@@ -6492,7 +6492,7 @@ nc_server_config_oper_get_user_password_last_modified(const char *ch_client, con
64926492 const char * username , time_t * last_modified )
64936493{
64946494 int rc = 0 ;
6495- LY_ARRAY_COUNT_TYPE i ;
6495+ LY_ARRAY_COUNT_TYPE i = 0 ;
64966496 struct nc_server_ssh_opts * ssh_opts = NULL ;
64976497 struct nc_endpt * endpt = NULL ;
64986498 struct nc_ch_client * client = NULL ;
0 commit comments