Skip to content

Commit 2c57184

Browse files
committed
filter user input: disable zero size tile or icon
Fix #115
1 parent e22c2aa commit 2c57184

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/alttab.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ static int use_args_and_xrm(int *argc, char **argv)
349349
else
350350
die(inv, "tile height");
351351
}
352+
if (g.option_tileW == 0 || g.option_tileH == 0)
353+
die(inv, "tile width or height: can't be zero");
352354

353355
g.option_iconW = DEFICONW;
354356
g.option_iconH = DEFICONH;
@@ -364,6 +366,8 @@ static int use_args_and_xrm(int *argc, char **argv)
364366
else
365367
die(inv, "icon height");
366368
}
369+
if (g.option_iconW == 0 || g.option_iconH == 0)
370+
die(inv, "icon width or height: can't be zero");
367371

368372
msg(0, "%dx%d tile, %dx%d icon\n",
369373
g.option_tileW, g.option_tileH, g.option_iconW, g.option_iconH);

0 commit comments

Comments
 (0)