summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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),