Skip to content

Commit 554476d

Browse files
Roytakmichalvasko
authored andcommitted
server config UPDATE initialize iterators
avoids warnings on release build
1 parent 7af2808 commit 554476d

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/server_config.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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
179179
nc_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
243243
nc_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
275275
nc_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
30683068
config_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);
@@ -4100,7 +4100,7 @@ config_asymmetric_key_cert(const struct lyd_node *node, enum nc_operation parent
41004100
enum nc_operation op;
41014101
struct nc_certificate *cert = NULL;
41024102
const char *name;
4103-
LY_ARRAY_COUNT_TYPE i;
4103+
LY_ARRAY_COUNT_TYPE i = 0;
41044104

41054105
NC_NODE_GET_OP(node, parent_op, &op);
41064106

@@ -4170,7 +4170,7 @@ config_asymmetric_key(const struct lyd_node *node, enum nc_operation parent_op,
41704170
enum nc_operation op;
41714171
const char *name;
41724172
struct nc_keystore_entry *entry = NULL;
4173-
LY_ARRAY_COUNT_TYPE i;
4173+
LY_ARRAY_COUNT_TYPE i = 0;
41744174

41754175
NC_NODE_GET_OP(node, parent_op, &op);
41764176

@@ -4385,7 +4385,7 @@ config_certificate_bag_cert(const struct lyd_node *node, enum nc_operation paren
43854385
enum nc_operation op;
43864386
struct nc_certificate *cert = NULL;
43874387
const char *name;
4388-
LY_ARRAY_COUNT_TYPE i;
4388+
LY_ARRAY_COUNT_TYPE i = 0;
43894389

43904390
NC_NODE_GET_OP(node, parent_op, &op);
43914391

@@ -4439,7 +4439,7 @@ config_certificate_bag(const struct lyd_node *node, enum nc_operation parent_op,
44394439
enum nc_operation op;
44404440
const char *name;
44414441
struct nc_certificate_bag *bag = NULL;
4442-
LY_ARRAY_COUNT_TYPE i;
4442+
LY_ARRAY_COUNT_TYPE i = 0;
44434443
uint32_t j;
44444444
struct ly_set *set = NULL;
44454445

@@ -4572,7 +4572,7 @@ config_public_key_bag_pubkey(const struct lyd_node *node, enum nc_operation pare
45724572
enum nc_operation op;
45734573
const char *name;
45744574
struct nc_public_key *pubkey = NULL;
4575-
LY_ARRAY_COUNT_TYPE i;
4575+
LY_ARRAY_COUNT_TYPE i = 0;
45764576

45774577
NC_NODE_GET_OP(node, parent_op, &op);
45784578

@@ -4624,7 +4624,7 @@ config_public_key_bag(const struct lyd_node *node, enum nc_operation parent_op,
46244624
enum nc_operation op;
46254625
const char *name;
46264626
struct nc_public_key_bag *bag = NULL;
4627-
LY_ARRAY_COUNT_TYPE i;
4627+
LY_ARRAY_COUNT_TYPE i = 0;
46284628
struct ly_set *set = NULL;
46294629
uint32_t j;
46304630

@@ -4851,7 +4851,7 @@ config_cert_exp_notif_interval(const struct lyd_node *node, enum nc_operation pa
48514851
struct lyd_node *anchor_node, *period_node;
48524852
enum nc_operation op;
48534853
const char *anchor_str, *period_str;
4854-
uint32_t i;
4854+
LY_ARRAY_COUNT_TYPE i = 0;
48554855
struct nc_cert_exp_time anchor = {0}, period = {0};
48564856
struct nc_cert_exp_time_interval *interval = NULL;
48574857

@@ -5241,7 +5241,7 @@ nc_server_config_reconcile_chclients_dispatch(struct nc_server_config *old_cfg,
52415241
struct nc_ch_client *old_ch_client, *new_ch_client;
52425242
struct nc_server_ch_thread_arg **ch_thread_arg;
52435243
int found;
5244-
LY_ARRAY_COUNT_TYPE i;
5244+
LY_ARRAY_COUNT_TYPE i = 0;
52455245
char **started_clients = NULL, **client_name = NULL;
52465246

52475247
if (!server_opts.ch_dispatch_data.acquire_ctx_cb || !server_opts.ch_dispatch_data.release_ctx_cb ||
@@ -5765,7 +5765,7 @@ static int
57655765
nc_server_config_truststore_dup(const struct nc_truststore *src, struct nc_truststore *dst)
57665766
{
57675767
int rc = 0;
5768-
LY_ARRAY_COUNT_TYPE i, j;
5768+
LY_ARRAY_COUNT_TYPE i = 0, j = 0;
57695769
const struct nc_certificate_bag *src_cbag;
57705770
struct nc_certificate_bag *dst_cbag;
57715771
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

Comments
 (0)