summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-12-16 16:54:58 +0100
committerPeter Wu <lekensteyn@gmail.com>2013-12-16 16:54:58 +0100
commit50164e335254bdf6200db421835fc34cc5a291c2 (patch)
tree2aae7fef9e42e44af379ca89a415618b9b9b5d9c
parenta1a94db67818bedde40e4022a1a3c4ffadda1b79 (diff)
downloadscripts-50164e335254bdf6200db421835fc34cc5a291c2.tar.gz
common-bytes.py: fix uneven line match
-rwxr-xr-xcommon-bytes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/common-bytes.py b/common-bytes.py
index 362203e..b1f41ba 100755
--- a/common-bytes.py
+++ b/common-bytes.py
@@ -15,9 +15,9 @@ def read_lines(files, line_width, lines_limit):
for line in fileinput.input(files=files):
lineno += 1
line = line.rstrip()
- line_len = len(line)
if line_width > 0:
line = line[:line_width]
+ line_len = len(line)
if line_width > 0 and line_len != line_width:
print("Line {} has a different length {} (expected {})"\
.format(lineno, line_len, line_width),