aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-skip-pattern.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-04-09 23:46:17 +0200
committerMattias Andrée <maandree@kth.se>2017-04-09 23:46:17 +0200
commitdac6950d9e556d5521ad7913d27a6cf83e2a90a1 (patch)
treebb6a65d973337a0504117888d5534967cc51f479 /src/blind-skip-pattern.c
parentClean up (diff)
downloadblind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.gz
blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.bz2
blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.xz
Clean up
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-skip-pattern.c')
-rw-r--r--src/blind-skip-pattern.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/blind-skip-pattern.c b/src/blind-skip-pattern.c
index 1debeca..8fdf570 100644
--- a/src/blind-skip-pattern.c
+++ b/src/blind-skip-pattern.c
@@ -14,8 +14,7 @@ process_frame(struct stream *stream, int include, size_t rown)
size_t h, n;
int anything = 0;
- for (h = stream->height; h;) {
- h--;
+ for (h = stream->height; h; h--) {
for (n = rown; n; n -= stream->ptr) {
stream->ptr = 0;
if (!eread_stream(stream, n))
@@ -27,7 +26,7 @@ process_frame(struct stream *stream, int include, size_t rown)
}
done:
- if (anything && (h || n || stream->frames))
+ if (anything && h)
eprintf("%s: is shorted than expected\n", stream->file);
return !anything;
@@ -44,9 +43,7 @@ main(int argc, char *argv[])
UNOFLAGS(!argc);
- stream.fd = STDIN_FILENO;
- stream.file = "<stdin>";
- einit_stream(&stream);
+ eopen_stream(&stream, NULL);
includes = emalloc((size_t)argc);
ns = ecalloc((size_t)argc, sizeof(*ns));
@@ -67,11 +64,12 @@ main(int argc, char *argv[])
total += (size_t)include;
}
+ echeck_frame_size(stream.width, 1, stream.pixel_size, 0, stream.file);
+ rown = stream.width * stream.pixel_size;
stream.frames = total;
fprint_stream_head(stdout, &stream);
efflush(stdout, "<stdout>");
- rown = stream.width * stream.pixel_size;
for (i = 0;; i = (i + 1) % argc) {
include = (int)includes[i];
n = ns[i];