aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-03-06 20:42:35 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-03-07 09:09:54 +0100
commit8045711f3c4985b5fb85c5359a6cb516af09fe06 (patch)
tree7882faa8d9bbeb689497e3c49303f4d839145eb3 /build-aux
parent9e0a53e697ff704df3c7db53412488ec27b04d43 (diff)
downloadexternal_libqmi-8045711f3c4985b5fb85c5359a6cb516af09fe06.zip
external_libqmi-8045711f3c4985b5fb85c5359a6cb516af09fe06.tar.gz
external_libqmi-8045711f3c4985b5fb85c5359a6cb516af09fe06.tar.bz2
dms: activation code string needs explicit 1-byte length prefix
Reported by Arman Uguray <armansito@google.com>
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/qmi-codegen/VariableString.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/build-aux/qmi-codegen/VariableString.py b/build-aux/qmi-codegen/VariableString.py
index a127eb7..faa2085 100644
--- a/build-aux/qmi-codegen/VariableString.py
+++ b/build-aux/qmi-codegen/VariableString.py
@@ -49,17 +49,17 @@ class VariableString(Variable):
self.is_fixed_size = False
# Variable-length strings in heap
self.needs_dispose = True
- # Strings which are given as the full value of a TLV will NOT have a
- # length prefix
- if 'type' in dictionary and dictionary['type'] == 'TLV':
- self.length_prefix_size = 0
- elif 'size-prefix-format' in dictionary:
+ if 'size-prefix-format' in dictionary:
if dictionary['size-prefix-format'] == 'guint8':
self.length_prefix_size = 8
elif dictionary['size-prefix-format'] == 'guint16':
self.length_prefix_size = 16
else:
raise ValueError('Invalid size prefix format (%s): not guint8 or guint16' % dictionary['size-prefix-format'])
+ # Strings which are given as the full value of a TLV and which don't have
+ # a explicit 'size-prefix-format' will NOT have a length prefix
+ elif 'type' in dictionary and dictionary['type'] == 'TLV':
+ self.length_prefix_size = 0
else:
# Default to UINT8
self.length_prefix_size = 8