generate-alt-random: assert that lines/cols/width/height are > 0

This commit is contained in:
Daniel Eklöf 2021-04-22 10:57:27 +02:00
parent 17bc2f5070
commit da5a3bae3e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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