From 7e44e6e6a458478adc57fa4d7560e473da5226f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miha=20Frange=C5=BE?= Date: Fri, 3 Apr 2026 22:48:25 +0200 Subject: [PATCH] Fix handling of null-terminated callsigns --- pe/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pe/__init__.py b/pe/__init__.py index 946acef..36d7c49 100644 --- a/pe/__init__.py +++ b/pe/__init__.py @@ -1269,8 +1269,8 @@ def unpack(cls, bytes): (port, data_kind, pid, call_from, call_to, data_len) = struct.unpack( _HDR_FMT, bytes) data_kind = chr(data_kind) - call_from = call_from.decode('utf-8', 'replace').rstrip('\0') - call_to = call_to.decode('utf-8', 'replace').rstrip('\0') + call_from = call_from.decode('utf-8', 'replace').split('\0')[0] + call_to = call_to.decode('utf-8', 'replace').split('\0')[0] return cls(port, data_kind, pid, call_from, call_to, data_len)