aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-19 18:28:35 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-19 18:28:35 +0000
commit81dc0e7eb9dc97f52d92777cdd1e0337eb3a1eaa (patch)
treeff31b65d061962de0cda98c2075e6ecc276608e8 /utils.py
parent60c80e35c7abbfcacd01f64fe42726e7155eac16 (diff)
fancy tlv fixes
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@60 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index 62902a8..f5d81d6 100644
--- a/utils.py
+++ b/utils.py
@@ -12,7 +12,7 @@ def represent_binary_fancy(len, value, mask = 0):
else:
result.append( "." )
mask = mask >> 1
- value = value >> 2
+ value = value >> 1
result.reverse()
return "".join(result).strip()
@@ -24,7 +24,7 @@ def parse_binary(value, bytemasks, verbose = False, value_len = 8):
for mask, byte, nonmatch, match in bytemasks:
if verbose:
- prefix = represent_binary_fancy(value_len, byte, mask) + ": "
+ prefix = represent_binary_fancy(value_len, value, mask) + ": "
else:
prefix = ""
if (value & mask) == (byte & mask):