diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 90bef7dc65..9b8dd13f05 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -910,7 +910,8 @@ void FixAveTime::invoke_vector(bigint ntimestep) fflush(fp); if (overwrite) { long fileend = ftell(fp); - if (fileend > 0) ftruncate(fileno(fp),fileend); + if ((fileend > 0) && (ftruncate(fileno(fp),fileend))) + perror("Error while tuncating output"); } } }