Skip to content

Comments

Change: remove redundant inits in print_report_xml_start#2781

Open
mattmundell wants to merge 1 commit intomainfrom
smaller-print-report-9-2
Open

Change: remove redundant inits in print_report_xml_start#2781
mattmundell wants to merge 1 commit intomainfrom
smaller-print-report-9-2

Conversation

@mattmundell
Copy link
Contributor

What

Remove inits of ctx.f_host_* in print_report_xml_start.

I'm making this a very small change, to keep review easier. This function is big and messy.

Why

They are redundant.

ctx is initialized with print_report_context_t ctx = {0};, which ensures that all fields are 0 (which is NULL for pointers).

References

Follows /pull/2776.

Breakdown of /pull/2712.

Testing

I ran GET_REPORTS on branch and main, and compared the output.

o m m '<get_reports report_id="82f3531c-43cd-4453-8300-990dc423d96b" filter="apache levels=hm" details="1"/>' > /tmp/r-pr
o m m '<get_reports report_id="82f3531c-43cd-4453-8300-990dc423d96b" filter="apache levels=hm" details="1"/>' > /tmp/r-main
o m m '<get_reports details="1"/>' > /tmp/r2-pr
o m m '<get_reports details="1"/>' > /tmp/r2-main
diff -u /tmp/r-pr /tmp/r-main
diff -u /tmp/r2-pr /tmp/r2-main

ctx is initialized with `print_report_context_t ctx = {0};`, which ensures that
all fields are 0 (which is NULL for pointers).
@mattmundell mattmundell requested review from a team as code owners February 19, 2026 13:17
@greenbonebot greenbonebot enabled auto-merge (rebase) February 19, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant