From ce54e63830421435115663436d120f2319bb711d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 12 Jul 2018 14:11:04 -0400 Subject: fixed bug --- src/analyze_correlations.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/analyze_correlations.cpp b/src/analyze_correlations.cpp index c429c1b..f0fbd15 100644 --- a/src/analyze_correlations.cpp +++ b/src/analyze_correlations.cpp @@ -201,6 +201,10 @@ int main (int argc, char *argv[]) { sprintf(filename_B, "wolff_%lu_E_OO.dat", id); + if (length > M) { + length = M; + } + FILE *file_E = fopen(filename_B, "wb"); fwrite(&M_f, sizeof(double), 1, file_E); fwrite(&mean_E, sizeof(double), 1, file_E); @@ -286,6 +290,10 @@ int main (int argc, char *argv[]) { compute_OO(M, forward_plan, forward_data, reverse_plan, reverse_data); + if (length > M) { + length = M; + } + sprintf(filename_E, "wolff_%lu_E_OO.dat", id); FILE *file_E_new = fopen(filename_E, "wb"); fwrite(&M_f, sizeof(double), 1, file_E_new); -- cgit v1.2.3-70-g09d2