From 478b53f935264bdfe4efe394f8d804a1361a6770 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 8 Apr 2017 13:57:36 +0200 Subject: Document memory requirements, minor style fixes, more use of BUFSIZ, fix warnings, and fix potential buffer overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-single-colour.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/blind-single-colour.c') diff --git a/src/blind-single-colour.c b/src/blind-single-colour.c index 2784f97..a0f5ccb 100644 --- a/src/blind-single-colour.c +++ b/src/blind-single-colour.c @@ -16,7 +16,7 @@ main(int argc, char *argv[]) struct stream stream; double X, Y, Z, alpha = 1; size_t x, y, n; - pixel_t buf[1024]; + pixel_t buf[BUFSIZ / 4]; ssize_t r; int inf = 0; char *arg; @@ -27,17 +27,17 @@ main(int argc, char *argv[]) ARGBEGIN { case 'f': - arg = EARG(); + arg = UARGF(); if (!strcmp(arg, "inf")) inf = 1, stream.frames = 0; else stream.frames = etozu_flag('f', arg, 1, SIZE_MAX); break; case 'w': - stream.width = etozu_flag('w', EARG(), 1, SIZE_MAX); + stream.width = etozu_flag('w', UARGF(), 1, SIZE_MAX); break; case 'h': - stream.height = etozu_flag('h', EARG(), 1, SIZE_MAX); + stream.height = etozu_flag('h', UARGF(), 1, SIZE_MAX); break; default: usage(); -- cgit v1.2.3-70-g09d2