laforge has submitted this change. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email )
Change subject: osmocom.construct.PaddedBcdAdapter: Support zero-length strings
......................................................................
osmocom.construct.PaddedBcdAdapter: Support zero-length strings
We cannot use the [-1] slicing if the input string has zero length.
Fix typo in docstring while we're touching that class anyway.
Change-Id: Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
---
M src/osmocom/construct.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/osmocom/construct.py b/src/osmocom/construct.py
index d369bc7..548f22d 100644
--- a/src/osmocom/construct.py
+++ b/src/osmocom/construct.py
@@ -262,11 +262,11 @@
return h2b(swap_nibbles(obj))
class PaddedBcdAdapter(BcdAdapter):
- """Representatin of a BCD string of potentially odd number of BCD digits,
+ """Representation of a BCD string of potentially odd number of BCD digits,
which then need to be padded at the end with an 'f' nibble."""
def _decode(self, obj, context, path):
r = super()._decode(obj, context, path)
- if r[-1] == 'f':
+ if len(r) >= 1 and r[-1] == 'f':
return r[:-1]
else:
return r
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
Gerrit-Change-Number: 41731
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email )
Change subject: osmocom.construct.PaddedBcdAdapter: Support zero-length strings
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
Gerrit-Change-Number: 41731
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 17:03:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41732?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim/ts_51_011: Properly re-compute ScAddr length
......................................................................
pySim/ts_51_011: Properly re-compute ScAddr length
EF.SMSP contains up to two addresses: Both are stored in a fixed-length
field of 12 octets. However, the actually used size depends on the
number of digits in the respective number. Let's compute that length
field properly
Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105
---
M pySim/ts_51_011.py
M pySim/utils.py
2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/41732/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41732?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105
Gerrit-Change-Number: 41732
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>