mmcli: correctly set key_length

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/559
This commit is contained in:
Amol Lad
2022-04-28 12:02:02 +02:00
committed by Aleksander Morgado
parent 5a050f8604
commit 4d0400b77f
+3 -1
View File
@@ -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++;
}