Skip to content
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

lib: Fix uninitialized variable issue in shapiroe.c #3994

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

ShubhamDesai
Copy link
Contributor

This pull request addresses the uninitialized variable issue in shapiroe.c identified by cppcheck.

Issues
shapiroe.c:22:17: error: Uninitialized variable: xs [uninitvar]
b = (mean - xs) * sqrt((double)n / (n - 1.0));
^
shapiroe.c:11:19: note: Assuming condition is false
for (i = 0; i < n; ++i)
^
shapiroe.c:22:17: note: Uninitialized variable: xs
b = (mean - xs) * sqrt((double)n / (n - 1.0));

Changes Made
Initialized xs to the first element of the array x to ensure it is properly set before being used in subsequent calculations.

@github-actions github-actions bot added C Related code is in C libraries labels Jul 7, 2024
@marisn marisn merged commit 1c3c303 into OSGeo:main Jul 8, 2024
26 checks passed
@neteler neteler added this to the 8.5.0 milestone Jul 8, 2024
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Jul 23, 2024
Co-authored-by: Shubham Vasudeo Desai <sdesai8@vclvm179-2.vcl.ncsu.edu>
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 libraries
3 participants