From d6c07e7fa021e13b5b9914cb15f13c711ecd387d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 15 Jan 2017 17:15:47 +0100 Subject: Use macros to write the head 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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/blind-concat.c') diff --git a/src/blind-concat.c b/src/blind-concat.c index bea127a..f6fe504 100644 --- a/src/blind-concat.c +++ b/src/blind-concat.c @@ -80,9 +80,7 @@ concat_to_file(int argc, char *argv[], char *output_file) close(stream.fd); } - sprintf(head, "%zu %zu %zu %s\n%cuivf%zn", - stream.frames, stream.width, stream.height, stream.pixfmt, 0, &headlen); - + SPRINTF_HEAD_ZN(head, stream.frames, stream.width, stream.height, stream.pixfmt, &headlen); ewriteall(fd, head, (size_t)headlen, output_file); data = mmap(0, size + (size_t)headlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); @@ -131,8 +129,7 @@ concat_to_file_parallel(int argc, char *argv[], char *output_file, size_t jobs) frames += streams[i].frames; } - sprintf(head, "%zu %zu %zu %s\n%cuivf%zn", - frames, streams->width, streams->height, streams->pixfmt, 0, &headlen); + SPRINTF_HEAD_ZN(head, frames, streams->width, streams->height, streams->pixfmt, &headlen); echeck_frame_size(streams->width, streams->height, streams->pixel_size, 0, output_file); frame_size = streams->width * streams->height * streams->pixel_size; -- cgit v1.2.3-70-g09d2