From 8487fa1c2997ff5a51669f3ab0cd40cc5382618d Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 23 Apr 2019 09:57:43 +0200 Subject: [PATCH] fix: non-trivial designated initializers not supported --- lib/nodes/file.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/nodes/file.cpp b/lib/nodes/file.cpp index 21c4e70ce..4a256554d 100644 --- a/lib/nodes/file.cpp +++ b/lib/nodes/file.cpp @@ -306,13 +306,15 @@ int file_start(struct node *n) if (f->epoch_mode != file::epoch::ORIGINAL) { io_rewind(&f->io); - struct sample s = { .capacity = 0 }; - struct sample *smps[] = { &s }; - if (io_eof(&f->io)) { warning("Empty file"); } else { + struct sample s; + struct sample *smps[] = { &s }; + + s.capacity = 0; + ret = io_scan(&f->io, smps, 1); if (ret == 1) { f->first = s.ts.origin;