From c22007cc4be9b731d97006b983538388c4b36033 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 May 2017 21:36:00 +0200 Subject: Fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-concat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/blind-concat.c') diff --git a/src/blind-concat.c b/src/blind-concat.c index f7d31e3..25cf19d 100644 --- a/src/blind-concat.c +++ b/src/blind-concat.c @@ -48,7 +48,7 @@ concat_to_file(int argc, char *argv[], char *output_file) int fd = eopen(output_file, O_RDWR | O_CREAT | O_TRUNC, 0666); char head[STREAM_HEAD_MAX]; ssize_t headlen; - size_t size = 0; + size_t size; off_t pos; char *data; @@ -72,9 +72,9 @@ concat_to_file(int argc, char *argv[], char *output_file) SPRINTF_HEAD_ZN(head, stream.frames, stream.width, stream.height, stream.pixfmt, &headlen); ewriteall(fd, head, (size_t)headlen, output_file); - if ((pos = elseek(fd, 0, SEEK_CUR, output_file)) > SIZE_MAX) + size = (size_t)(pos = elseek(fd, 0, SEEK_CUR, output_file)); + if ((uintmax_t)pos > SIZE_MAX) eprintf("%s\n", strerror(EFBIG)); - size = pos; data = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) -- cgit v1.2.3-70-g09d2