From 9c01d64804cfd5265924ac62b4e4ea3dca54049f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 13 Dec 2023 19:21:06 -0500 Subject: [PATCH] avoid accessing uninitialized data --- src/ML-SNAP/compute_sna_atom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ML-SNAP/compute_sna_atom.cpp b/src/ML-SNAP/compute_sna_atom.cpp index 753751690d..3fe3cca92d 100644 --- a/src/ML-SNAP/compute_sna_atom.cpp +++ b/src/ML-SNAP/compute_sna_atom.cpp @@ -627,7 +627,7 @@ double ComputeSNAAtom::sum_weights(double * rsq, double * w, int ncounts) double ComputeSNAAtom::get_target_rcut(double S_target, double * rsq, double rcut, int ncounts, int weightmode, double delta) { - double S_sol; + double S_sol = 0.0; if (weightmode == 0) { double * www = weights(rsq, rcut, ncounts); S_sol = sum_weights(rsq, www, ncounts);