aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-output.c
diff options
context:
space:
mode:
authorAmol Lad <amol.lad@4rf.com>2022-04-28 14:45:13 +0530
committerAleksander Morgado <aleksander@aleksander.es>2022-04-28 12:02:02 +0200
commit4d0400b77f38f0d371a8dd018206029756343746 (patch)
tree1ab64729922f6215016bc38fa8d704258902aa98 /cli/mmcli-output.c
parent5a050f86042f07d946345f0dd80eb45743dee616 (diff)
mmcli: correctly set key_length
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/559
Diffstat (limited to 'cli/mmcli-output.c')
-rw-r--r--cli/mmcli-output.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c
index 5483e56a..14367bf5 100644
--- a/cli/mmcli-output.c
+++ b/cli/mmcli-output.c
@@ -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++;
}