mmcli: correctly set key_length
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/559
This commit is contained in:
committed by
Aleksander Morgado
parent
5a050f8604
commit
4d0400b77f
+3
-1
@@ -1446,8 +1446,10 @@ dump_output_list_keyvalue (MmcF field)
|
||||
}
|
||||
|
||||
if (n > 0) {
|
||||
guint aux = n;
|
||||
|
||||
key_length += ((strlen (KEY_ARRAY_VALUE_SUFFIX)) + 3);
|
||||
if (n > 10)
|
||||
while ((aux /= 10) > 0)
|
||||
key_length++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user