aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2014-12-12 10:22:10 +0100
committerAleksander Morgado <aleksander@aleksander.es>2014-12-12 10:22:44 +0100
commitb84db57fe24652238a06c8aaff70f769ccfa6a0e (patch)
treedc5f6e83f3828bfef58590e8575ce9ee1bf5794d /configure.ac
parentb9c3701e3371984736240d2dded70c2d52f3b46e (diff)
qmi-codegen: fix printing contents of structs with fixed sized strings
If the fixed sized string contains no characters or is shorter than the explicit size, NUL bytes will be included. If we try to append exactly the size of the string, we'll end up with embedded NULs in our string to print, so the actual output will be cut, even if the string is longer after the embedded NUL bytes. E.g.: >>>>>> TLV: >>>>>> type = "GERAN Info" (0x10) >>>>>> length = 61 >>>>>> value = 00:00:00:00:00:00:00:00:00:00:00:00:FF:FF:FF:FF:28:00:03:7D:6F:00:00:32:F4:51:B3:00:4D:00:11:2A:00:8A:3C:00:00:32:F4:51:B3:00:63:00:30:14:00:89:3C:00:00:32:F4:51:B3:00:59:00:11:0D:00 >>>>>> translated = [ cell_id = '0' plmn = ' With this fix, we avoid this by explicitly finishing ourselves the fixed sized string with a NUL byte, and then adding the C string as the non-fixed sized ones, i.e. until the first NUL byte is found. E.g.: >>>>>> TLV: >>>>>> type = "GERAN Info" (0x10) >>>>>> length = 61 >>>>>> value = 00:00:00:00:00:00:00:00:00:00:00:00:FF:FF:FF:FF:28:00:03:7D:6F:00:00:32:F4:51:B3:00:4D:00:11:2A:00:8A:3C:00:00:32:F4:51:B3:00:63:00:30:14:00:89:3C:00:00:32:F4:51:B3:00:59:00:11:0D:00 >>>>>> translated = [ cell_id = '0' plmn = '' lac = '0' geran_absolute_rf_channel_number = '0' base_station_identity_code = '0' timing_advance = '4294967295' rx_level = '40' cell = '{ [0] = '[ cell_id = '28541' plmn = '2\xf4Q' lac = '179' geran_absolute_rf_channel_number = '77' base_station_identity_code = '17' rx_level = '42' ] ' [1] = '[ cell_id = '15498' plmn = '2\xf4Q' lac = '179' geran_absolute_rf_channel_number = '99' base_station_identity_code = '48' rx_level = '20' ] ' [2] = '[ cell_id = '15497' plmn = '2\xf4Q' lac = '179' geran_absolute_rf_channel_number = '89' base_station_identity_code = '17' rx_level = '13' ] '}' ]
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions