From 4bc5351facc563fc85a870c9bba726a761481c24 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 19 Jul 2014 15:23:42 +0300 Subject: [PATCH] errors.py should fail if one file is empty --- errors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/errors.py b/errors.py index 391b0cf..c4d3af2 100755 --- a/errors.py +++ b/errors.py @@ -7,6 +7,9 @@ tx = bytearray(open(tx).read()) rx = bytearray(open(rx).read()) L = min(len(tx), len(rx)) +if L == 0: + sys.exit(1) + rx = list(common.to_bits(rx[:L])) tx = list(common.to_bits(tx[:L])) indices = [index for index, (r, t) in enumerate(zip(rx, tx)) if r != t]