Skip to content

Commit

Permalink
nethsm: Fix value length calculation in table formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Nov 27, 2023
1 parent c58aa0a commit 037e1d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pynitrokey/cli/nethsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ def print_table(headers: Sequence[str], data: Iterable[Sequence[Any]]) -> None:
for row in data:
str_row = []
for i in range(len(widths)):
str_row.append(str(row[i]))
widths[i] = max(widths[i], len(row[i]))
str_value = str(row[i])
str_row.append(str_value)
widths[i] = max(widths[i], len(str_value))
str_data.append(str_row)

print_row(headers, widths)
Expand Down

0 comments on commit 037e1d0

Please sign in to comment.