aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b37d1dae0..43e9c4939 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3771,10 +3771,12 @@ operate(struct Configurable *config, int argc, char *argv[])
" bytes\n", outs.bytes);
fflush(outs.stream);
/* truncate file at the position where we started appending */
+#ifdef HAVE_FTRUNCATE
ftruncate( fileno(outs.stream), outs.init);
+#endif
/* now seek to the end of the file, the position where we
just truncated the file */
- fseek(outs.stream, 0, SEEK_END);
+ fseek(outs.stream, outs.init, SEEK_SET);
outs.bytes = 0; /* clear for next round */
}
continue;