From 118c2e5be351919101e166cd3a6d3b17461ee64c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 19 Oct 2019 16:36:13 -0400 Subject: [PATCH] missed one unchecked call to ftruncate() --- src/fix_ave_time.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); } } }