aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-concat.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-05-10 21:36:00 +0200
committerMattias Andrée <maandree@kth.se>2017-05-10 21:37:20 +0200
commitc22007cc4be9b731d97006b983538388c4b36033 (patch)
treebabca238e7be3fbc111d62318e1f919107a37e2b /src/blind-concat.c
parentCleaner code (diff)
downloadblind-c22007cc4be9b731d97006b983538388c4b36033.tar.gz
blind-c22007cc4be9b731d97006b983538388c4b36033.tar.bz2
blind-c22007cc4be9b731d97006b983538388c4b36033.tar.xz
Fix warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-concat.c')
-rw-r--r--src/blind-concat.c6
1 files changed, 3 insertions, 3 deletions
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)