Skip to content

Commit

Permalink
Added name length check
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryPTB committed Mar 14, 2024
1 parent 8169745 commit 85e9572
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions synop2bufr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,8 @@ def truncate_to_twenty(name: str) -> str:
Returns:
str: This name truncated to 20 characters.
"""
if len(name) <= 20:
return name
LOGGER.info(f"Truncating station name {name} to 20 characters")
return name[:20]

Expand Down

0 comments on commit 85e9572

Please sign in to comment.