qmicli: fix PLMN printing
BCD PLMNs with 2 digit MNCs will have an 'F' digit between the MCC and the MNC. This maps to \0, which would cause a truncated result string with only the MCC. Signed-off-by: Bjørn Mork <bjorn@mork.no>
This commit is contained in:
parent
4aed63cf6b
commit
6f988368fd
|
@ -2233,8 +2233,12 @@ str_from_bcd_plmn (const gchar *bcd)
|
|||
|
||||
str = g_malloc (7);
|
||||
for (i = 0, j = 0 ; i < 3; i++) {
|
||||
str[j++] = bcd_chars[bcd[i] & 0xF];
|
||||
str[j++] = bcd_chars[(bcd[i] >> 4) & 0xF];
|
||||
str[j] = bcd_chars[bcd[i] & 0xF];
|
||||
if (str[j])
|
||||
j++;
|
||||
str[j] = bcd_chars[(bcd[i] >> 4) & 0xF];
|
||||
if (str[j])
|
||||
j++;
|
||||
}
|
||||
str[j] = '\0';
|
||||
|
||||
|
|
Loading…
Reference in New Issue