aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-single-colour.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-04-08 13:57:36 +0200
committerMattias Andrée <maandree@kth.se>2017-04-08 13:57:36 +0200
commit478b53f935264bdfe4efe394f8d804a1361a6770 (patch)
tree31c87de7b67f928ff93b4564e0929d7db2a369f8 /src/blind-single-colour.c
parentUpdate TODO: blind-from-sent (diff)
downloadblind-478b53f935264bdfe4efe394f8d804a1361a6770.tar.gz
blind-478b53f935264bdfe4efe394f8d804a1361a6770.tar.bz2
blind-478b53f935264bdfe4efe394f8d804a1361a6770.tar.xz
Document memory requirements, minor style fixes, more use of BUFSIZ, fix warnings, and fix potential buffer overflow
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-single-colour.c')
-rw-r--r--src/blind-single-colour.c8
1 files changed, 4 insertions, 4 deletions
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();