Skip to content

d.labels: Fix uninitialized variable issue in do_labels.c #5604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShubhamDesai
Copy link
Contributor

This pull request fixes issue identified by Coverity Scan (CID : 1208552)
The variable Y was used uninitialized in the case where the parsing loop was skipped. To address this, I initialized Y as:
Y = north - (line_size * 1.2);
An alternative could have been:
Y = north - (line_size * 1.2) - ((n_lines - 1) * line_size);
However, since n_lines is initially set to 0, this simplifies to:
Y = north - (line_size * 0.2)

@github-actions github-actions bot added C Related code is in C module display labels Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C display module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant