From 878849c465604d90d236b3c8766bf75a4b6836d2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 7 May 2017 16:48:25 +0200 Subject: Add blind-convert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-next-frame.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/blind-next-frame.c') diff --git a/src/blind-next-frame.c b/src/blind-next-frame.c index 14d2326..bd47f1d 100644 --- a/src/blind-next-frame.c +++ b/src/blind-next-frame.c @@ -56,9 +56,8 @@ main(int argc, char *argv[]) w = stream.width * stream.pixel_size; for (; stream.frames; stream.frames--) { for (h = stream.height; h; h--) { - for (n = w; n; n -= stream.ptr) { - stream.ptr = 0; - if (!enread_stream(2, &stream, n)) + for (n = w; n; n -= stream.ptr, stream.ptr = 0) { + if (!stream.ptr && !enread_stream(2, &stream, n)) goto done; anything = 1; enwriteall(2, STDOUT_FILENO, stream.buf, stream.ptr, ""); -- cgit v1.2.3-70-g09d2