Skip to content

Commit aa01af1

Browse files
committed
Fix CodeClimate problem
Make the type of this variable a pointer-to-const. The current type of "profile" is "struct xccdf_profile *".
1 parent 32dbcd0 commit aa01af1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

utils/oscap-info.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static void _print_rules_for_profile(struct xccdf_policy_model *policy_model, co
411411
}
412412
struct xccdf_select_iterator *sel_it = xccdf_policy_get_selected_rules(policy);
413413
while (xccdf_select_iterator_has_more(sel_it)) {
414-
struct xccdf_select *sel = xccdf_select_iterator_next(sel_it);
414+
const struct xccdf_select *sel = xccdf_select_iterator_next(sel_it);
415415
printf("%s\n", xccdf_select_get_item(sel));
416416
}
417417
xccdf_select_iterator_free(sel_it);
@@ -423,16 +423,16 @@ static void _print_vars_for_profile(struct xccdf_policy_model *policy_model, con
423423
if (policy == NULL) {
424424
return;
425425
}
426-
struct xccdf_profile *profile = xccdf_policy_get_profile(policy);
426+
const struct xccdf_profile *profile = xccdf_policy_get_profile(policy);
427427
if (profile == NULL) {
428428
return;
429429
}
430430

431-
struct xccdf_benchmark *bench = xccdf_policy_model_get_benchmark(policy_model);
431+
const struct xccdf_benchmark *bench = xccdf_policy_model_get_benchmark(policy_model);
432432

433433
struct xccdf_setvalue_iterator *sv_it = xccdf_profile_get_setvalues(profile);
434434
while (xccdf_setvalue_iterator_has_more(sv_it)) {
435-
struct xccdf_setvalue *sv = xccdf_setvalue_iterator_next(sv_it);
435+
const struct xccdf_setvalue *sv = xccdf_setvalue_iterator_next(sv_it);
436436
const char *value_id = xccdf_setvalue_get_item(sv);
437437
struct xccdf_item *item = xccdf_benchmark_get_item(bench, value_id);
438438
if (item != NULL) {
@@ -445,7 +445,7 @@ static void _print_vars_for_profile(struct xccdf_policy_model *policy_model, con
445445

446446
struct xccdf_refine_value_iterator *rv_it = xccdf_profile_get_refine_values(profile);
447447
while (xccdf_refine_value_iterator_has_more(rv_it)) {
448-
struct xccdf_refine_value *rv = xccdf_refine_value_iterator_next(rv_it);
448+
const struct xccdf_refine_value *rv = xccdf_refine_value_iterator_next(rv_it);
449449
const char *value_id = xccdf_refine_value_get_item(rv);
450450
struct xccdf_item *item = xccdf_benchmark_get_item(bench, value_id);
451451
if (item != NULL) {

0 commit comments

Comments
 (0)