summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyze_correlations.cpp8
1 files changed, 8 insertions, 0 deletions
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);