diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-04-22 08:57:27 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-04-22 08:57:27 +0000 |
| commit | da5a3bae3e9a514983d33ad45ea4a3d3bba443b8 (patch) | |
| tree | 74540dbc4f8b2f2523e357700a7b1a2e8678bda8 | |
| parent | generate-alt-random: use {width,height} + 1 in randrange() (diff) | |
generate-alt-random: assert that lines/cols/width/height are > 0
| -rwxr-xr-x | scripts/generate-alt-random-writes.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/generate-alt-random-writes.py b/scripts/generate-alt-random-writes.py index 8aa4835c..33033081 100755 --- a/scripts/generate-alt-random-writes.py +++ b/scripts/generate-alt-random-writes.py @@ -59,6 +59,11 @@ def main(): if lines is None or cols is None or height is None or width is None: raise Exception('could not get terminal width/height; use --rows and --cols') + assert lines > 0, f'{lines}' + assert cols > 0, f'{cols}' + assert width > 0, f'{width}' + assert height > 0, f'{height}' + # Number of characters to write to screen count = 256 * 1024**1 |
